diff options
author | Laszlo Papp <ext-laszlo.papp@nokia.com> | 2011-03-09 17:22:07 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-03-30 19:34:58 +0200 |
commit | b0ceaa067057cf91caa180636d2e4c3dc786a98f (patch) | |
tree | 1fdb4eb4735afefe8e5dee936415e037cb0664c0 /lib/mount.c | |
parent | d6bec4020fddd4dd67248789a1af600580f2cbda (diff) |
Check the negative return value after an open syscall
Diffstat (limited to 'lib/mount.c')
-rw-r--r-- | lib/mount.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mount.c b/lib/mount.c index 224ae9d..8065087 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -366,8 +366,10 @@ static int fuse_mount_fusermount(const char *mountpoint, const char *opts, if (quiet) { int fd = open("/dev/null", O_RDONLY); - dup2(fd, 1); - dup2(fd, 2); + if (fd != -1) { + dup2(fd, 1); + dup2(fd, 2); + } } argv[a++] = FUSERMOUNT_PROG; |