Check the negative return value after an open syscall

This commit is contained in:
Laszlo Papp
2011-03-09 17:22:07 +02:00
committed by Miklos Szeredi
parent d6bec4020f
commit b0ceaa0670
+4 -2
View File
@@ -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;