X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=214af7723cc7f708e67340584cdce7d9ff5b3a12;hb=c134aa17fcb7a7730ff9e76010cb1eecb51852a7;hp=dbeaeac0ce400338301c9e9cd968541be41fc00b;hpb=bfa20ccde2a70b1252dbb614132f1a4cbee815d4;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index dbeaeac..214af77 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.52 1999/01/19 23:59:39 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(devnam, tty_mode) != 0) { + /* XXX if devnam is a symlink, this will change the link */ + chmod(devnam, tty_mode); + } + } close(ttyfd); ttyfd = -1;