]> git.ozlabs.org Git - ppp.git/commitdiff
add ioctl for SIGIO to establish_ppp
authorPaul Mackerras <paulus@samba.org>
Fri, 27 May 1994 01:02:48 +0000 (01:02 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 27 May 1994 01:02:48 +0000 (01:02 +0000)
pppd/sys-linux.c

index cbf05589ef37a1a2b2b26b4bbbf32f4851a21e7b..aa829aad9201abcbe914cddf415fef34071a2e96 100644 (file)
@@ -94,6 +94,7 @@ int set_kdebugflag (int requested_level)
 void establish_ppp (void)
 {
     int pppdisc = N_PPP;
 void establish_ppp (void)
 {
     int pppdisc = N_PPP;
+    int sig = SIGIO;
 
     if (ioctl(fd, TIOCEXCL, 0) < 0) {
        syslog (LOG_WARNING, "ioctl(TIOCEXCL): %m");
 
     if (ioctl(fd, TIOCEXCL, 0) < 0) {
        syslog (LOG_WARNING, "ioctl(TIOCEXCL): %m");
@@ -115,6 +116,14 @@ void establish_ppp (void)
     }
 
     set_kdebugflag (kdebugflag);
     }
 
     set_kdebugflag (kdebugflag);
+
+    /*
+     * Set the device to give us a SIGIO when data is available.
+     */
+    if (ioctl(fd, PPPIOCSINPSIG, &sig) == -1) {
+       syslog(LOG_ERR, "ioctl(PPPIOCSINPSIG): %m");
+       die(1);
+    }
 }
 
 /*
 }
 
 /*