]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/main.c
fix MT stuff; add DEBUG to compile command line for now
[ppp.git] / pppd / main.c
index dbeaeac0ce400338301c9e9cd968541be41fc00b..f5614b972a40191c46727b727151f1b45916999d 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.51 1998/11/07 06:59:28 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.53 1999/02/26 10:38:51 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -827,8 +827,12 @@ close_tty()
 
     restore_tty(ttyfd);
 
-    if (tty_mode != (mode_t) -1)
-       chmod(devnam, tty_mode);
+    if (tty_mode != (mode_t) -1) {
+       if (fchmod(ttyfd, tty_mode) != 0) {
+           /* XXX if devnam is a symlink, this will change the link */
+           chmod(devnam, tty_mode);
+       }
+    }
 
     close(ttyfd);
     ttyfd = -1;