From e70db67c018f34f404ae9ef5a992e7a67d377301 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 31 Jul 2017 09:34:33 -0400 Subject: [PATCH] rofiles-fuse: Add missing error handling for fcntl() Spotted by Coverity. Coverity CID: 1452201 Closes: #1037 Approved by: jlebon --- src/rofiles-fuse/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rofiles-fuse/main.c b/src/rofiles-fuse/main.c index 12a9d886..88cdba6c 100644 --- a/src/rofiles-fuse/main.c +++ b/src/rofiles-fuse/main.c @@ -96,6 +96,8 @@ callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler, if (!*path) { dfd = fcntl (basefd, F_DUPFD_CLOEXEC, 3); + if (dfd < 0) + return -errno; lseek (dfd, 0, SEEK_SET); } else