From 69deda53a85df68656b62acdd45662101fef58b7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 24 Oct 2012 21:35:39 -0700 Subject: [PATCH] Don't assume process IDs fit in int. * emacs.c (shut_down_emacs) [!DOS_NT]: * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]: * term.c (dissociate_if_controlling_tty) [!DOS_NT]: Use pid_t, not int, to store process IDs, as 'int' is not wide enough on a few platforms (e.g., AIX and IRIX). --- src/ChangeLog | 9 +++++++++ src/emacs.c | 4 ++-- src/sysdep.c | 2 +- src/term.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e59a286110d..835c550b426 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-10-25 Paul Eggert + + Don't assume process IDs fit in int. + * emacs.c (shut_down_emacs) [!DOS_NT]: + * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]: + * term.c (dissociate_if_controlling_tty) [!DOS_NT]: + Use pid_t, not int, to store process IDs, as 'int' + is not wide enough on a few platforms (e.g., AIX and IRIX). + 2012-10-23 Kenichi Handa The following change is to make face-font-rescale-alist work diff --git a/src/emacs.c b/src/emacs.c index 0a2a60bee0c..7f3228641ae 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1903,8 +1903,8 @@ shut_down_emacs (int sig, Lisp_Object stuff) /* If we are controlling the terminal, reset terminal modes. */ #ifndef DOS_NT { - int pgrp = EMACS_GETPGRP (0); - int tpgrp = tcgetpgrp (0); + pid_t pgrp = EMACS_GETPGRP (0); + pid_t tpgrp = tcgetpgrp (0); if ((tpgrp != -1) && tpgrp == pgrp) { reset_all_sys_modes (); diff --git a/src/sysdep.c b/src/sysdep.c index 35beeaa7202..c7174e91612 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -452,7 +452,7 @@ sys_suspend (void) #if defined (SIGTSTP) && !defined (MSDOS) { - int pgrp = EMACS_GETPGRP (0); + pid_t pgrp = EMACS_GETPGRP (0); EMACS_KILLPG (pgrp, SIGTSTP); } diff --git a/src/term.c b/src/term.c index f7c87b7608d..74b02b0af27 100644 --- a/src/term.c +++ b/src/term.c @@ -2919,7 +2919,7 @@ static void dissociate_if_controlling_tty (int fd) { #ifndef DOS_NT - int pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ + pid_t pgid = tcgetpgrp (fd); /* If tcgetpgrp succeeds, fd is the ctty. */ if (pgid != -1) { #if defined (USG5) -- 2.39.2