projects
/
openvswitch
/ 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 b5977172203d0a351c829f938119681a4c555003..58581b77890d5d48abd6dc3ceb61300f2d3b7b4d 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);