]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/utils.c
__linux__ (already defined by compiler) not _linux_ (manually defined)
[ppp.git] / pppd / utils.c
index 43ed3172c7e61ff564bdae0739488828735b592e..69d2a9383f0117ee05a5d017037b91e72fed6141 100644 (file)
@@ -17,7 +17,7 @@
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define RCSID  "$Id: utils.c,v 1.16 2002/01/11 18:27:17 etbe Exp $"
+#define RCSID  "$Id: utils.c,v 1.19 2002/10/27 12:56:26 fcusack Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -209,6 +209,28 @@ vslprintf(buf, buflen, fmt, args)
        neg = 0;
        ++fmt;
        switch (c) {
        neg = 0;
        ++fmt;
        switch (c) {
+       case 'l':
+           c = *fmt++;
+           switch (c) {
+           case 'd':
+               val = va_arg(args, long);
+               if (val < 0) {
+                   neg = 1;
+                   val = -val;
+               }
+               base = 10;
+               break;
+           case 'u':
+               val = va_arg(args, unsigned long);
+               base = 10;
+               break;
+           default:
+               *buf++ = '%'; --buflen;
+               *buf++ = 'l'; --buflen;
+               --fmt;          /* so %lz outputs %lz etc. */
+               continue;
+           }
+           break;
        case 'd':
            i = va_arg(args, int);
            if (i < 0) {
        case 'd':
            i = va_arg(args, int);
            if (i < 0) {
@@ -796,7 +818,7 @@ dump_packet(const char *tag, unsigned char *p, int len)
 
 /* Procedures for locking the serial device using a lock file. */
 #ifndef LOCK_DIR
 
 /* Procedures for locking the serial device using a lock file. */
 #ifndef LOCK_DIR
-#ifdef _linux_
+#ifdef __linux__
 #define LOCK_DIR       "/var/lock"
 #else
 #ifdef SVR4
 #define LOCK_DIR       "/var/lock"
 #else
 #ifdef SVR4
@@ -821,7 +843,7 @@ lock(dev)
 
     result = mklock (dev, (void *) 0);
     if (result == 0) {
 
     result = mklock (dev, (void *) 0);
     if (result == 0) {
-       strlcpy(lock_file, sizeof(lock_file), dev);
+       strlcpy(lock_file, dev, sizeof(lock_file));
        return 0;
     }
 
        return 0;
     }