diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-05-02 08:05:09 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-05-02 08:05:09 +0000 |
commit | ead11a4adfaf25b7ca6ca91b7e531369958a581a (patch) | |
tree | 17ef1094bc1c7c6025e3668faae89e99d7ef2a1d /libc/termios/tcgetpgrp.c | |
parent | ae0badd7421c76b6e5820e80a2ab3c56786dff18 (diff) |
Nickolai Zeldovich writes:
Currently, tcgetpgrp() in uClibc uses an int to store a PID (fetched
via ioctl TIOCGPGRP). This causes problems on platforms where pid_t
is defined to be larger (e.g., uint64_t). Other functions in termios,
such as tcgetsid() and tcsetpgrp(), already pass a pid_t to ioctl(),
so the following patch does the same in tcgetpgrp() as well.
Diffstat (limited to 'libc/termios/tcgetpgrp.c')
-rw-r--r-- | libc/termios/tcgetpgrp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/termios/tcgetpgrp.c b/libc/termios/tcgetpgrp.c index 241670770..1ad317139 100644 --- a/libc/termios/tcgetpgrp.c +++ b/libc/termios/tcgetpgrp.c @@ -27,10 +27,10 @@ libc_hidden_proto(ioctl) /* Return the foreground process group ID of FD. */ pid_t tcgetpgrp (int fd) { - int pgrp; + pid_t pgrp; if (ioctl (fd, TIOCGPGRP, &pgrp) < 0) - return (pid_t) -1; - return (pid_t) pgrp; + return -1; + return pgrp; } libc_hidden_def (tcgetpgrp) |