git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
637bae3
)
Fix test for fcntl return value.
author
Ben Pfaff
<blp@nicira.com>
Thu, 28 Aug 2008 20:15:32 +0000
(13:15 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 28 Aug 2008 20:15:32 +0000
(13:15 -0700)
POSIX only says that -1 is an error; other return values have unspecified
meanings.
lib/daemon.c
patch
|
blob
|
history
diff --git
a/lib/daemon.c
b/lib/daemon.c
index
b597717
..
58581b7
100644
(file)
--- a/
lib/daemon.c
+++ b/
lib/daemon.c
@@
-103,7
+103,7
@@
make_pidfile(void)
lck.l_whence = SEEK_SET;
lck.l_start = 0;
lck.l_len = 0;
- if (fcntl(fd, F_SETLK, &lck)
>= 0
) {
+ if (fcntl(fd, F_SETLK, &lck)
!= -1
) {
char *text = xasprintf("%ld\n", pid);
if (write(fd, text, strlen(text)) == strlen(text)) {
fatal_signal_add_file_to_unlink(pidfile);