From 9471ec45a1452bf2de3581675bc7ea7fbd33093f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 5 May 2016 16:09:51 -0600 Subject: [PATCH] Cast the return value of fcntl() to void when setting FD_CLOEXEC. Coverity CID 104075, 104076, 104077. --- plugins/group_file/getgrent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/group_file/getgrent.c b/plugins/group_file/getgrent.c index 99eeca101..8192919f9 100644 --- a/plugins/group_file/getgrent.c +++ b/plugins/group_file/getgrent.c @@ -65,7 +65,7 @@ mysetgrent(void) if (grf == NULL) { grf = fopen(grfile, "r"); if (grf != NULL) - fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); + (void)fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); } else { rewind(grf); } @@ -139,7 +139,7 @@ mygetgrnam(const char *name) if (grf == NULL) { if ((grf = fopen(grfile, "r")) == NULL) return NULL; - fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); + (void)fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); } else { rewind(grf); } @@ -162,7 +162,7 @@ mygetgrgid(gid_t gid) if (grf == NULL) { if ((grf = fopen(grfile, "r")) == NULL) return NULL; - fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); + (void)fcntl(fileno(grf), F_SETFD, FD_CLOEXEC); } else { rewind(grf); } -- 2.40.0