X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=f5614b972a40191c46727b727151f1b45916999d;hp=dbeaeac0ce400338301c9e9cd968541be41fc00b;hb=a83d9887bdc27bcbf285a3fd7964d2ddac52b1f5;hpb=bfa20ccde2a70b1252dbb614132f1a4cbee815d4 diff --git a/pppd/main.c b/pppd/main.c index dbeaeac..f5614b9 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -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 @@ -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;