From: Laszlo Papp Date: Wed, 9 Mar 2011 15:22:07 +0000 (+0200) Subject: Check the negative return value after an open syscall X-Git-Tag: fuse_2_9_0~68 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b0ceaa067057cf91caa180636d2e4c3dc786a98f;p=qemu-gpiodev%2Flibfuse.git Check the negative return value after an open syscall --- 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;