]> git.ozlabs.org Git - ppp.git/commitdiff
make establish_ppp and open_ppp_loopback return the correct fd
authorPaul Mackerras <paulus@samba.org>
Tue, 16 Mar 1999 22:53:49 +0000 (22:53 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 16 Mar 1999 22:53:49 +0000 (22:53 +0000)
pppd/sys-NeXT.c
pppd/sys-aix4.c
pppd/sys-bsd.c
pppd/sys-linux.c
pppd/sys-osf.c
pppd/sys-sunos4.c
pppd/sys-svr4.c
pppd/sys-ultrix.c

index 830213652d8a9ca55219d8633380560a774e5fe5..373fb58b5f546a9fe6d3528097673dced4983d51 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-NeXT.c,v 1.13 1999/03/16 02:57:05 paulus Exp $";
+static char rcsid[] = "$Id: sys-NeXT.c,v 1.14 1999/03/16 22:53:46 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -184,7 +184,7 @@ file in the ppp-2.2 distribution.\n";
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -224,6 +224,7 @@ establish_ppp(fd)
        warn("Couldn't set device to non-blocking mode: %m");
     }
 
+    return fd;
 }
 
 
@@ -1516,7 +1517,7 @@ sifnpmode(u, proto, mode)
  * packets in demand mode, and connect it to a ppp interface.
  * Here we use a pty.
  */
-void
+int
 open_ppp_loopback()
 {
 
@@ -1568,6 +1569,7 @@ open_ppp_loopback()
        }
     }
 
+    return loop_master;
 #endif
 
 }
index 7de3ff60d53894ba3a4ee0ae7be859aa8914b196..9c92e3ffb565126a50cf68e6d4bc830285d20b1d 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-aix4.c,v 1.16 1999/03/16 02:57:05 paulus Exp $";
+static char rcsid[] = "$Id: sys-aix4.c,v 1.17 1999/03/16 22:53:46 paulus Exp $";
 #endif
 
 /*
@@ -183,7 +183,7 @@ ppp_available()
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -242,6 +242,8 @@ establish_ppp(fd)
        || fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) {
        warn("Couldn't set device to non-blocking mode: %m");
     }
+
+    return fd;
 }
 
 /*
index b830e01c3935851040b4a3ab96571639db2fa4ca..afb644eda8d17629c86befccdf8aef430798e384 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-bsd.c,v 1.37 1999/03/16 02:57:06 paulus Exp $";
+static char rcsid[] = "$Id: sys-bsd.c,v 1.38 1999/03/16 22:53:47 paulus Exp $";
 /*     $NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $ */
 #endif
 
@@ -202,7 +202,7 @@ file in the ppp-2.2 distribution.\n";
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -265,6 +265,8 @@ establish_ppp(fd)
        || fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) {
        warn("Couldn't set device to non-blocking mode: %m");
     }
+
+    return fd;
 }
 
 /*
@@ -464,7 +466,7 @@ int fd, on;
  * packets in demand mode, and connect it to a ppp interface.
  * Here we use a pty.
  */
-void
+int
 open_ppp_loopback()
 {
     int flags;
@@ -512,6 +514,7 @@ open_ppp_loopback()
        }
     }
 
+    return loop_master;
 }
 
 
index 7f0e581ccee7fd3c1e0ba24c8ebc3dfe84f77915..0ed73fd81dc0ccda2a9388207ae64ae4eb22c6d2 100644 (file)
@@ -2108,8 +2108,7 @@ int cifaddr (int unit, u_int32_t our_adr, u_int32_t his_adr)
 /********************************************************************
  *
  * open_loopback - open the device we use for getting packets
- * in demand mode.  Under Linux, we use our existing fd
- * to the ppp driver.
+ * in demand mode.  Under Linux, we use a pty master/slave pair.
  */
 int
 open_ppp_loopback(void)
@@ -2167,7 +2166,7 @@ open_ppp_loopback(void)
  */
     set_kdebugflag (kdebugflag);
 
-    return ppp_fd;
+    return master_fd;
 }
 
 /********************************************************************
index f11a9961a418056e3dba54c136f87f2e1d07e936..9e82ae47635a10fa6b069227f27231e0a21d18f6 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-osf.c,v 1.19 1999/03/16 02:57:06 paulus Exp $";
+static char rcsid[] = "$Id: sys-osf.c,v 1.20 1999/03/16 22:53:48 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -344,7 +344,7 @@ streamify(int fd)
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -391,11 +391,14 @@ establish_ppp(fd)
 
     /*
      * Set device for non-blocking reads.
+     * XXX why do we need to do this?  don't we use pppfd not fd?
      */
     if ((initfdflags = fcntl(fd, F_GETFL)) == -1
         || fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) {
         warn("Couldn't set device to non-blocking mode: %m");
     }
+
+    return pppfd;
 }
 
 /*
@@ -704,12 +707,13 @@ int fd, on;
 
 /*
  * open_loopback - open the device we use for getting packets
- * in demand mode.  Under Solaris 2, we use our existing fd
+ * in demand mode.  Under Digital Unix, we use our existing fd
  * to the ppp driver.
  */
-void
+int
 open_ppp_loopback()
 {
+    return pppfd;
 }
 
 /*
index b0d0eaaf8ef21149abd7b60b920fead6ae1d65b7..40117422cf9a9e0f9c5798da38a68722966fe447 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-sunos4.c,v 1.14 1999/03/16 02:57:07 paulus Exp $";
+static char rcsid[] = "$Id: sys-sunos4.c,v 1.15 1999/03/16 22:53:48 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -240,7 +240,7 @@ ppp_available()
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -262,6 +262,8 @@ establish_ppp(fd)
     /* Link the serial port under the PPP multiplexor. */
     if ((fdmuxid = ioctl(pppfd, I_LINK, fd)) < 0)
        fatal("Can't link tty to PPP mux: %m");
+
+    return pppfd;
 }
 
 /*
@@ -558,12 +560,13 @@ int fd, on;
 
 /*
  * open_loopback - open the device we use for getting packets
- * in demand mode.  Under Solaris 2, we use our existing fd
+ * in demand mode.  Under SunOS, we use our existing fd
  * to the ppp driver.
  */
-void
+int
 open_ppp_loopback()
 {
+    return pppfd;
 }
 
 /*
index efaaef02151b783d02224f5a11fa53ba65980a02..e6d3d67f117824e080cd17eb293b36f3278be18d 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-svr4.c,v 1.25 1999/03/16 02:57:07 paulus Exp $";
+static char rcsid[] = "$Id: sys-svr4.c,v 1.26 1999/03/16 22:53:48 paulus Exp $";
 #endif
 
 #include <limits.h>
@@ -260,7 +260,7 @@ ppp_available()
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -290,6 +290,8 @@ establish_ppp(fd)
     /* Link the serial port under the PPP multiplexor. */
     if ((fdmuxid = ioctl(pppfd, I_LINK, fd)) < 0)
        fatal("Can't link tty to PPP mux: %m");
+
+    return pppfd;
 }
 
 /*
@@ -624,9 +626,10 @@ int fd, on;
  * in demand mode.  Under Solaris 2, we use our existing fd
  * to the ppp driver.
  */
-void
+int
 open_ppp_loopback()
 {
+    return pppfd;
 }
 
 /*
index 53c8f7cba51470b14e6b42986f73608342a2ceb7..b9da26b72a895ef74230f977a7d1b4b08e060e96 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-ultrix.c,v 1.26 1999/03/16 02:57:08 paulus Exp $";
+static char rcsid[] = "$Id: sys-ultrix.c,v 1.27 1999/03/16 22:53:49 paulus Exp $";
 #endif
 
 /*
@@ -205,7 +205,7 @@ file in the ppp-2.2 distribution.\n";
 /*
  * establish_ppp - Turn the serial port into a ppp interface.
  */
-void
+int
 establish_ppp(fd)
     int fd;
 {
@@ -254,6 +254,8 @@ establish_ppp(fd)
        || fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) {
        warn("Couldn't set device to non-blocking mode: %m");
     }
+
+    return fd;
 }
 
 /*
@@ -550,11 +552,11 @@ int fd, on;
  * packets in demand mode, and connect it to a ppp interface.
  * Here we use would use a pty, except that Ultrix ptys are brain-dead.
  */
-void
+int
 open_ppp_loopback()
 {
-    error("open_ppp_loopback called!");
-    die(1);
+    fatal("open_ppp_loopback called!");
+    /* return loop_master; */
 }