projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2621a3a
)
Check the return value properly before passing it to any function
author
Laszlo Papp
<ext-laszlo.papp@nokia.com>
Tue, 15 Mar 2011 08:33:08 +0000
(10:33 +0200)
committer
Miklos Szeredi
<mszeredi@suse.cz>
Wed, 30 Mar 2011 17:34:58 +0000
(19:34 +0200)
util/ulockmgr_server.c
patch
|
blob
|
history
diff --git
a/util/ulockmgr_server.c
b/util/ulockmgr_server.c
index 8ffdfef92b6a878cde5f7e38639d463f12e3d8f3..583fcf9f9ec54b6ad5cc540b1365b7042bc1d7f2 100644
(file)
--- a/
util/ulockmgr_server.c
+++ b/
util/ulockmgr_server.c
@@
-366,8
+366,10
@@
int main(int argc, char *argv[])
}
cfd = 4;
nullfd = open("/dev/null", O_RDWR);
- dup2(nullfd, 0);
- dup2(nullfd, 1);
+ if (nullfd >= 0) {
+ dup2(nullfd, 0);
+ dup2(nullfd, 1);
+ }
close(3);
closefrom(5);
while (1) {