svn commit: trunk/uClibc/libc/termios

vapier at uclibc.org vapier at uclibc.org
Wed May 2 08:05:09 UTC 2007


Author: vapier
Date: 2007-05-02 01:05:09 -0700 (Wed, 02 May 2007)
New Revision: 18536

Log:
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.


Modified:
   trunk/uClibc/libc/termios/tcgetpgrp.c


Changeset:
Modified: trunk/uClibc/libc/termios/tcgetpgrp.c
===================================================================
--- trunk/uClibc/libc/termios/tcgetpgrp.c	2007-05-02 08:03:22 UTC (rev 18535)
+++ trunk/uClibc/libc/termios/tcgetpgrp.c	2007-05-02 08:05:09 UTC (rev 18536)
@@ -27,10 +27,10 @@
 /* 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)




More information about the uClibc-cvs mailing list