Contents of /trunk/ppp/patches/ppp-2.4.5-dev-ppp.patch
Parent Directory | Revision Log
Revision 1107 -
(show annotations)
(download)
Fri Aug 20 10:59:46 2010 UTC (14 years, 1 month ago) by niro
File size: 1294 byte(s)
Fri Aug 20 10:59:46 2010 UTC (14 years, 1 month ago) by niro
File size: 1294 byte(s)
-reworked patch to apply with ppp-2.4.5
1 | diff -Naur ppp-2.4.5/pppd/sys-linux.c ppp-2.4.5-magellan/pppd/sys-linux.c |
2 | --- ppp-2.4.5/pppd/sys-linux.c 2009-11-16 23:26:07.000000000 +0100 |
3 | +++ ppp-2.4.5-magellan/pppd/sys-linux.c 2010-08-20 12:50:10.000000000 +0200 |
4 | @@ -2031,6 +2031,18 @@ |
5 | kernel_version = KVERSION(osmaj, osmin, ospatch); |
6 | |
7 | fd = open("/dev/ppp", O_RDWR); |
8 | + if (fd < 0) { |
9 | + err = errno; |
10 | + /* try making it and see if that helps. */ |
11 | + if (err == ENOENT && mknod("/dev/ppp", S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, |
12 | + makedev(108, 0)) >= 0) { |
13 | + fd = open("/dev/ppp", O_RDWR); |
14 | + if (fd >= 0) |
15 | + info("Created /dev/ppp device node"); |
16 | + else |
17 | + unlink("/dev/ppp"); /* didn't work, undo the mknod */ |
18 | + } |
19 | + } |
20 | if (fd >= 0) { |
21 | new_style_driver = 1; |
22 | |
23 | @@ -2041,16 +2053,15 @@ |
24 | close(fd); |
25 | return 1; |
26 | } |
27 | - err = errno; |
28 | |
29 | if (kernel_version >= KVERSION(2,3,13)) { |
30 | error("Couldn't open the /dev/ppp device: %m"); |
31 | - if (errno == ENOENT) |
32 | + if (err == ENOENT) |
33 | no_ppp_msg = |
34 | "You need to create the /dev/ppp device node by\n" |
35 | "executing the following command as root:\n" |
36 | " mknod /dev/ppp c 108 0\n"; |
37 | - else if (errno == ENODEV || errno == ENXIO) |
38 | + else if (err == ENODEV || err == ENXIO) |
39 | no_ppp_msg = |
40 | "Please load the ppp_generic kernel module.\n"; |
41 | return 0; |