OSDN Git Service

Initial Contribution
[android-x86/external-ppp.git] / pppd / sys-linux.c
similarity index 99%
rename from sys-linux.c
rename to pppd/sys-linux.c
index e963c79..a4c43d1 100644 (file)
@@ -92,6 +92,7 @@
 #include <ctype.h>
 #include <termios.h>
 #include <unistd.h>
+#include <paths.h>
 
 /* This is in netdevice.h. However, this compile will fail miserably if
    you attempt to include netdevice.h because it has so many references
    really don't use it, but it must be defined, define it now. */
 
 #ifndef MAX_ADDR_LEN
-#define MAX_ADDR_LEN 7
+#define xxMAX_ADDR_LEN 7
 #endif
 
 #if __GLIBC__ >= 2
 #include <linux/route.h>
 #include <linux/if_ether.h>
 #endif
+#include <linux/sockios.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
@@ -1090,6 +1092,7 @@ int read_packet (unsigned char *buf)
        len -= 2;
     }
     nr = -1;
+
     if (ppp_fd >= 0) {
        nr = read(ppp_fd, buf, len);
        if (nr < 0 && errno != EWOULDBLOCK && errno != EAGAIN
@@ -1388,7 +1391,7 @@ static char *path_to_procfs(const char *tail)
        /* Default the mount location of /proc */
        strlcpy (proc_path, "/proc", sizeof(proc_path));
        proc_path_len = 5;
-       fp = fopen(MOUNTED, "r");
+       fp = fopen(_PATH_MOUNTED, "r");
        if (fp != NULL) {
            while ((mntent = getmntent(fp)) != NULL) {
                if (strcmp(mntent->mnt_type, MNTTYPE_IGNORE) == 0)
@@ -2558,7 +2561,7 @@ get_pty(master_fdp, slave_fdp, slave_name, uid)
     if (mfd >= 0) {
        int ptn;
        if (ioctl(mfd, TIOCGPTN, &ptn) >= 0) {
-           slprintf(pty_name, sizeof(pty_name), "/dev/pts/%d", ptn);
+           slprintf(pty_name, sizeof(pty_name), "/dev.pts/%d", ptn);
            chmod(pty_name, S_IRUSR | S_IWUSR);
 #ifdef TIOCSPTLCK
            ptn = 0;