From f7b422a6520600055b2c57393aabd76c0be756c9 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 9 Mar 2012 12:45:24 -0500 Subject: [PATCH] Fix format string warning on Solaris with gcc 3.4.3. --HG-- branch : 1.8 --- src/exec_pty.c | 12 ++++++------ src/ttyname.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/exec_pty.c b/src/exec_pty.c index d40408c0f..01fb6796c 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -378,20 +378,20 @@ terminate_child(pid_t pid, bool use_pgrp) * Note that SIGCHLD will interrupt the sleep() */ 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); - sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGTERM", pid); + sudo_debug_printf(SUDO_DEBUG_INFO, "killpg %d SIGTERM", (int)pid); killpg(pid, SIGTERM); 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); } 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); - sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGTERM", pid); + sudo_debug_printf(SUDO_DEBUG_INFO, "kill %d SIGTERM", (int)pid); kill(pid, SIGTERM); 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); } diff --git a/src/ttyname.c b/src/ttyname.c index f8baa9716..e7030f846 100644 --- a/src/ttyname.c +++ b/src/ttyname.c @@ -164,7 +164,7 @@ get_process_ttyname(void) /* No tty for child, check the parent via /proc. */ ppid = getppid(); 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); if (fd != -1) { tty = ttyname(fd); -- 2.40.0