]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-str.c
Add prosthesis for SunOS, which doesn't have strtoul.
[ppp.git] / pppd / sys-str.c
index f5afba95d119d8da644d9952853a4e189371ccff..030ad58c8eb209fd2bd643c3deeffdfe60a62266 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-str.c,v 1.19 1995/04/28 06:26:46 paulus Exp $";
+static char rcsid[] = "$Id: sys-str.c,v 1.21 1995/06/12 12:18:04 paulus Exp $";
 #endif
 
 /*
@@ -452,6 +452,15 @@ void
 restore_tty()
 {
     if (restore_term) {
+       if (!default_device) {
+           /*
+            * Turn off echoing, because otherwise we can get into
+            * a loop with the tty and the modem echoing to each other.
+            * We presume we are the sole user of this tty device, so
+            * when we close it, it will revert to its defaults anyway.
+            */
+           inittermios.c_lflag &= ~(ECHO | ECHONL);
+       }
        if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0)
            if (errno != ENXIO)
                syslog(LOG_WARNING, "tcsetattr: %m");
@@ -1266,3 +1275,14 @@ unlock()
        lock_file = NULL;
     }
 }
+
+/*
+ * SunOS doesn't have strtoul :-(
+ */
+unsigned long
+strtoul(str, ptr, base)
+    char *str, **ptr;
+    int base;
+{
+    return (unsigned long) strtol(str, ptr, base);
+}