if (iol->enabled) {
fd = open(pathbuf, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR);
if (fd != -1) {
- fcntl(fd, F_SETFD, FD_CLOEXEC);
+ (void)fcntl(fd, F_SETFD, FD_CLOEXEC);
#ifdef HAVE_ZLIB_H
if (docompress)
iol->fd.g = gzdopen(fd, "w");
* on exec flag on the fd for fexecve(2).
*/
if (!is_script)
- fcntl(*fd, F_SETFD, FD_CLOEXEC);
+ (void)fcntl(*fd, F_SETFD, FD_CLOEXEC);
#endif /* HAVE_FEXECVE */
fclose(fp);
debug_return_bool(true);
if (pwf == NULL) {
pwf = fopen(pwfile, "r");
if (pwf != NULL)
- fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
+ (void)fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
} else {
rewind(pwf);
}
if (pwf == NULL) {
if ((pwf = fopen(pwfile, "r")) == NULL)
return NULL;
- fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
+ (void)fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
} else {
rewind(pwf);
}
if (pwf == NULL) {
if ((pwf = fopen(pwfile, "r")) == NULL)
return NULL;
- fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
+ (void)fcntl(fileno(pwf), F_SETFD, FD_CLOEXEC);
} else {
rewind(pwf);
}
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);
}
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);
}
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);
}
close(sv[0]);
close(signal_pipe[0]);
close(signal_pipe[1]);
- fcntl(sv[1], F_SETFD, FD_CLOEXEC);
+ (void)fcntl(sv[1], F_SETFD, FD_CLOEXEC);
exec_cmnd(details, &cstat, sv[1]);
send(sv[1], &cstat, sizeof(cstat), 0);
sudo_debug_exit_int(__func__, __FILE__, __LINE__, sudo_debug_subsys, 1);
close(sv[0]);
close(signal_pipe[0]);
close(signal_pipe[1]);
- fcntl(sv[1], F_SETFD, FD_CLOEXEC);
+ (void)fcntl(sv[1], F_SETFD, FD_CLOEXEC);
sigprocmask(SIG_SETMASK, omask, NULL);
/* Close the other end of the stdin/stdout/stderr pipes and exec. */
if (io_pipe[STDIN_FILENO][1])
close(signal_pipe[0]);
close(signal_pipe[1]);
close(errpipe[0]);
- fcntl(errpipe[1], F_SETFD, FD_CLOEXEC);
+ (void)fcntl(errpipe[1], F_SETFD, FD_CLOEXEC);
restore_signals();
/* setup tty and exec command */
add_preserved_fd(&details->preserved_fds, details->execfd);
#else
/* Plugin thinks we support fexecve() but we don't. */
- fcntl(details->execfd, F_SETFD, FD_CLOEXEC);
+ (void)fcntl(details->execfd, F_SETFD, FD_CLOEXEC);
details->execfd = -1;
#endif
break;