]> granicus.if.org Git - sudo/commitdiff
Cast the return value of fcntl() to void when setting FD_CLOEXEC.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 22:09:51 +0000 (16:09 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 22:09:51 +0000 (16:09 -0600)
Coverity CID 104075, 104076, 104077.

plugins/group_file/getgrent.c

index 99eeca10136f2de07f58fae2437c726f1dcc7974..8192919f9c325467cf23cb36f2177fb63ae474cf 100644 (file)
@@ -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);
     }