2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-05 08:45:28 +00:00

Fix -Wshadow warnings.

This commit is contained in:
Todd C. Miller
2020-09-25 15:09:45 -06:00
parent 7eda22c729
commit 88dcdcd11d
24 changed files with 151 additions and 181 deletions

View File

@@ -36,24 +36,24 @@ sudo_pipe2(int fildes[2], int flags)
if (pipe(fildes) != 0)
return -1;
if (ISSET(flags, O_NONBLOCK)) {
int flags = fcntl(fildes[0], F_GETFL, 0);
if (flags == -1)
goto bad;
if (fcntl(fildes[0], F_SETFL, flags | O_NONBLOCK) == -1)
goto bad;
flags = fcntl(fildes[1], F_GETFL, 0);
if (flags == -1)
goto bad;
if (fcntl(fildes[1], F_SETFL, flags | O_NONBLOCK) == -1)
goto bad;
}
if (ISSET(flags, O_CLOEXEC)) {
if (fcntl(fildes[0], F_SETFD, FD_CLOEXEC) == -1)
goto bad;
if (fcntl(fildes[1], F_SETFD, FD_CLOEXEC) == -1)
goto bad;
}
if (ISSET(flags, O_NONBLOCK)) {
int oflags = fcntl(fildes[0], F_GETFL, 0);
if (oflags == -1)
goto bad;
if (fcntl(fildes[0], F_SETFL, oflags | O_NONBLOCK) == -1)
goto bad;
oflags = fcntl(fildes[1], F_GETFL, 0);
if (oflags == -1)
goto bad;
if (fcntl(fildes[1], F_SETFL, oflags | O_NONBLOCK) == -1)
goto bad;
}
return 0;
bad:
close(fildes[0]);