summaryrefslogtreecommitdiff
path: root/user/ppp/20_all_dev-ppp.patch
blob: eff3e37f086192c08e64a74a0275d909b3975e25 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- ppp-2.4.6/pppd/sys-linux.c
+++ ppp-2.4.6/pppd/sys-linux.c
@@ -2031,6 +2031,17 @@
     kernel_version = KVERSION(osmaj, osmin, ospatch);
 
     fd = open("/dev/ppp", O_RDWR);
+    if (fd < 0) {
+	/* try making it and see if that helps. */
+	if (errno == ENOENT && mknod("/dev/ppp", S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP,
+		  makedev(108, 0)) >= 0) {
+	    fd = open("/dev/ppp", O_RDWR);
+	    if (fd >= 0)
+		info("Created /dev/ppp device node");
+	    else
+		unlink("/dev/ppp");     /* didn't work, undo the mknod */
+	}
+    }
     if (fd >= 0) {
 	new_style_driver = 1;