From: Todd C. Miller Date: Fri, 3 Mar 2017 18:20:56 +0000 (-0700) Subject: Add some casts to quiet gcc warnings on Solaris and remove a X-Git-Tag: SUDO_1_8_20^2~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00b4732c9d0e78ae1140b5cc7ca258bbdce8135a;p=sudo Add some casts to quiet gcc warnings on Solaris and remove a now-useless debug printf. --- diff --git a/plugins/sudoers/timestamp.c b/plugins/sudoers/timestamp.c index a3b32383c..0127a50aa 100644 --- a/plugins/sudoers/timestamp.c +++ b/plugins/sudoers/timestamp.c @@ -160,7 +160,7 @@ ts_mkdirs(char *path, uid_t owner, mode_t mode, mode_t parent_mode, bool quiet) if (ret) { /* Create final path component. */ sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO, - "mkdir %s, mode 0%o, uid %d, gid %d", path, mode, + "mkdir %s, mode 0%o, uid %d, gid %d", path, (int)mode, (int)owner, (int)parent_gid); if (mkdir(path, mode) != 0 && errno != EEXIST) { if (!quiet) diff --git a/src/exec_monitor.c b/src/exec_monitor.c index b447f47fa..0e6e74939 100644 --- a/src/exec_monitor.c +++ b/src/exec_monitor.c @@ -211,29 +211,27 @@ handle_sigchld(int backchannel, struct command_status *cstat) errno = ECHILD; /* FALLTHROUGH */ case -1: - sudo_debug_printf(SUDO_DEBUG_DIAG, - "waitpid returned %d, expected pid %d", pid, cmnd_pid); sudo_warn(U_("%s: %s"), __func__, "waitpid"); debug_return; } if (WIFCONTINUED(status)) { sudo_debug_printf(SUDO_DEBUG_INFO, "%s: command (%d) resumed", - __func__, cmnd_pid); + __func__, (int)cmnd_pid); } else if (WIFSTOPPED(status)) { if (sig2str(WSTOPSIG(status), signame) == -1) snprintf(signame, sizeof(signame), "%d", WSTOPSIG(status)); sudo_debug_printf(SUDO_DEBUG_INFO, "%s: command (%d) stopped, SIG%s", - __func__, cmnd_pid, signame); + __func__, (int)cmnd_pid, signame); } else if (WIFSIGNALED(status)) { if (sig2str(WTERMSIG(status), signame) == -1) snprintf(signame, sizeof(signame), "%d", WTERMSIG(status)); sudo_debug_printf(SUDO_DEBUG_INFO, "%s: command (%d) killed, SIG%s", - __func__, cmnd_pid, signame); + __func__, (int)cmnd_pid, signame); cmnd_pid = -1; } else if (WIFEXITED(status)) { sudo_debug_printf(SUDO_DEBUG_INFO, "%s: command (%d) exited: %d", - __func__, cmnd_pid, WEXITSTATUS(status)); + __func__, (int)cmnd_pid, WEXITSTATUS(status)); cmnd_pid = -1; } else { sudo_debug_printf(SUDO_DEBUG_WARN,