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:
@@ -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]);
|
||||
|
Reference in New Issue
Block a user