2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

pid_t is defined by POSIX as a signed integer type so we don't need

a cast when comparing to -1.
This commit is contained in:
Todd C. Miller
2016-05-04 14:14:38 -06:00
parent c70da6dcdf
commit 829917f008
3 changed files with 5 additions and 5 deletions

View File

@@ -560,7 +560,7 @@ dispatch_signal(struct sudo_event_base *evbase, pid_t child,
* with SIGTTOU while the command continues to run.
*/
sigaction_t sa, osa;
pid_t saved_pgrp = (pid_t)-1;
pid_t saved_pgrp = -1;
int signo = WSTOPSIG(status);
int fd = open(_PATH_TTY, O_RDWR|O_NOCTTY, 0);
if (fd != -1) {
@@ -895,7 +895,7 @@ handler(int s, siginfo_t *info, void *context)
*/
if (s != SIGCHLD && USER_SIGNALED(info) && info->si_pid != 0) {
pid_t si_pgrp = getpgid(info->si_pid);
if (si_pgrp != (pid_t)-1) {
if (si_pgrp != -1) {
if (si_pgrp == ppgrp || si_pgrp == cmnd_pid)
return;
} else if (info->si_pid == cmnd_pid) {
@@ -952,7 +952,7 @@ handler_user_only(int s, siginfo_t *info, void *context)
return;
if (info->si_pid != 0) {
pid_t si_pgrp = getpgid(info->si_pid);
if (si_pgrp != (pid_t)-1) {
if (si_pgrp != -1) {
if (si_pgrp == ppgrp || si_pgrp == cmnd_pid)
return;
} else if (info->si_pid == cmnd_pid) {