Fix format string warning on Solaris with gcc 3.4.3.

This commit is contained in:
Todd C. Miller
2012-03-09 12:45:24 -05:00
parent 4d1752d4d1
commit f745a041e2
2 changed files with 7 additions and 7 deletions

View File

@@ -378,20 +378,20 @@ terminate_child(pid_t pid, bool use_pgrp)
* Note that SIGCHLD will interrupt the sleep() * Note that SIGCHLD will interrupt the sleep()
*/ */
if (use_pgrp) { if (use_pgrp) {
sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGHUP", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGHUP", (int)pid);
killpg(pid, SIGHUP); killpg(pid, SIGHUP);
sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGTERM", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGTERM", (int)pid);
killpg(pid, SIGTERM); killpg(pid, SIGTERM);
sleep(2); sleep(2);
sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGKILL", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGKILL", (int)pid);
killpg(pid, SIGKILL); killpg(pid, SIGKILL);
} else { } else {
sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGHUP", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGHUP", (int)pid);
kill(pid, SIGHUP); kill(pid, SIGHUP);
sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGTERM", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGTERM", (int)pid);
kill(pid, SIGTERM); kill(pid, SIGTERM);
sleep(2); sleep(2);
sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGKILL", pid); sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGKILL", (int)pid);
kill(pid, SIGKILL); kill(pid, SIGKILL);
} }

View File

@@ -164,7 +164,7 @@ get_process_ttyname(void)
/* No tty for child, check the parent via /proc. */ /* No tty for child, check the parent via /proc. */
ppid = getppid(); ppid = getppid();
for (i = STDIN_FILENO; i < STDERR_FILENO && tty == NULL; i++) { for (i = STDIN_FILENO; i < STDERR_FILENO && tty == NULL; i++) {
snprintf(path, sizeof(path), "/proc/%d/fd/%d", ppid, i); snprintf(path, sizeof(path), "/proc/%d/fd/%d", (int)ppid, i);
fd = open(path, O_RDONLY|O_NOCTTY, 0); fd = open(path, O_RDONLY|O_NOCTTY, 0);
if (fd != -1) { if (fd != -1) {
tty = ttyname(fd); tty = ttyname(fd);