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:
b0ceaa0
)
Check the return value after an open syscall
author
Laszlo Papp
<ext-laszlo.papp@nokia.com>
Wed, 9 Mar 2011 16:01:30 +0000
(18:01 +0200)
committer
Miklos Szeredi
<mszeredi@suse.cz>
Wed, 30 Mar 2011 17:34:58 +0000
(19:34 +0200)
lib/mount_util.c
patch
|
blob
|
history
diff --git
a/lib/mount_util.c
b/lib/mount_util.c
index 5b660d653dd5fe2d5335c8283c0b35c7ea714384..aafddfbc18a3a077be29af31d405d84e59539ec5 100644
(file)
--- a/
lib/mount_util.c
+++ b/
lib/mount_util.c
@@
-100,8
+100,10
@@
static int add_mount(const char *progname, const char *fsname,
* --no-canonicalize
*/
int fd = open("/dev/null", O_WRONLY);
- dup2(fd, 1);
- dup2(fd, 2);
+ if (fd >= 0) {
+ dup2(fd, 1);
+ dup2(fd, 2);
+ }
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());