From: Todd C. Miller Date: Thu, 5 May 2016 22:09:51 +0000 (-0600) Subject: Cast the return value of fcntl() to void when setting FD_CLOEXEC. X-Git-Tag: SUDO_1_8_17^2~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9471ec45a1452bf2de3581675bc7ea7fbd33093f;p=sudo Cast the return value of fcntl() to void when setting FD_CLOEXEC. Coverity CID 104075, 104076, 104077. --- 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); }