]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/tty.c
Get rid of an unnecessary chmod (it wasn't being used on Linux anyway).
[ppp.git] / pppd / tty.c
index dbfc67e3864482c8d2e72790acceef72e23cd31f..4bac6484f4e063a49af6994090a9af6f74b25c68 100644 (file)
@@ -73,7 +73,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: tty.c,v 1.14 2004/01/17 05:47:55 carlsonj Exp $"
+#define RCSID  "$Id: tty.c,v 1.16 2004/10/28 00:16:37 paulus Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
@@ -300,7 +300,7 @@ setdevname(cp, argv, doit)
        if (*cp == 0)
                return 0;
 
-       if (strncmp("/dev/", cp, 5) != 0) {
+       if (*cp != '/') {
                strlcpy(dev, "/dev/", sizeof(dev));
                strlcat(dev, cp, sizeof(dev));
                cp = dev;
@@ -810,10 +810,8 @@ finish_tty()
 
 #ifndef __linux__
        if (tty_mode != (mode_t) -1) {
-               if (fchmod(real_ttyfd, tty_mode) != 0) {
-                       /* XXX if devnam is a symlink, this will change the link */
-                       chmod(devnam, tty_mode);
-               }
+               if (fchmod(real_ttyfd, tty_mode) != 0)
+                       error("Couldn't restore tty permissions");
        }
 #endif /* __linux__ */