]> granicus.if.org Git - sudo/commitdiff
Use POSIX tcgetpgrp() instead of BSD TIOCGPGRP ioctl
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jun 2010 13:57:41 +0000 (09:57 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 9 Jun 2010 13:57:41 +0000 (09:57 -0400)
--HG--
branch : 1.7

exec_pty.c

index 7c2940fda9d337cbbfa36e0a82818dd2af3c348e..12ae533a110643a95158754210784e9c234390a4 100644 (file)
@@ -1039,10 +1039,8 @@ sync_ttysize(src, dst)
 
     if (ioctl(src, TIOCGSIZE, &tsize) == 0) {
            ioctl(dst, TIOCSSIZE, &tsize);
-#ifdef TIOCGPGRP
-           if (ioctl(dst, TIOCGPGRP, &pgrp) == 0)
-                   killpg(pgrp, SIGWINCH);
-#endif
+           if ((pgrp = tcgetpgrp(dst)) != -1)
+               killpg(pgrp, SIGWINCH);
     }
 #endif
 }