]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-ultrix.c
chatchat stuff from gpk@onramp.net
[ppp.git] / pppd / sys-ultrix.c
index 82783be2095474dc89337f33e078bcd093d183dc..cc6520b9cae825c44cffe968e0e34cbd9be6c13b 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #ifndef lint
-static char rcsid[] = "$Id: sys-ultrix.c,v 1.29 1999/03/19 04:23:54 paulus Exp $";
+static char rcsid[] = "$Id: sys-ultrix.c,v 1.31 1999/04/12 06:24:52 paulus Exp $";
 #endif
 
 /*
@@ -150,7 +150,7 @@ sys_check_options()
     return 1;
 }
 
-
+#if 0
 /*
  * daemon - Detach us from the terminal session.
  */
@@ -174,6 +174,7 @@ daemon(nochdir, noclose)
     }
     return 0;
 }
+#endif
 
 /*
  * ppp_available - check whether the system has any ppp interfaces
@@ -801,7 +802,7 @@ get_idle_time(u, ip)
 int
 get_ppp_stats(u, stats)
     int u;
-    struct ppp_stats *stats;
+    struct pppd_stats *stats;
 {
     struct ifpppstatsreq req;
 
@@ -811,7 +812,8 @@ get_ppp_stats(u, stats)
        error("Couldn't get PPP statistics: %m");
        return 0;
     }
-    *stats = req.stats;
+    stats->bytes_in = req.stats.p.ppp_ibytes;
+    stats->bytes_out = req.stats.p.ppp_obytes;
     return 1;
 }
 
@@ -1297,9 +1299,9 @@ logwtmp(line, name, host)
     if ((fd = open(WTMPFILE, O_WRONLY|O_APPEND, 0)) < 0)
        return;
     if (!fstat(fd, &buf)) {
-       strlcpy(ut.ut_line, line, sizeof(ut.ut_line));
-       strlcpy(ut.ut_name, name, sizeof(ut.ut_name));
-       strlcpy(ut.ut_host, host, sizeof(ut.ut_host));
+       strncpy(ut.ut_line, line, sizeof(ut.ut_line));
+       strncpy(ut.ut_name, name, sizeof(ut.ut_name));
+       strncpy(ut.ut_host, host, sizeof(ut.ut_host));
        (void)time(&ut.ut_time);
        if (write(fd, (char *)&ut, sizeof(struct utmp)) != sizeof(struct utmp))
            (void)ftruncate(fd, buf.st_size);
@@ -1307,6 +1309,7 @@ logwtmp(line, name, host)
     close(fd);
 }
 
+#if 0
 /*
  * Routines for locking and unlocking the serial device, moved here
  * from chat.c.
@@ -1383,3 +1386,4 @@ unlock()
        lock_file = NULL;
     }
 }
+#endif