]> git.ozlabs.org Git - ppp.git/commitdiff
Made the exit return code be reported via WEXITSTATUS(status) instead of status,
authorRussell Coker <russell@coker.com.au>
Fri, 11 Jan 2002 18:10:16 +0000 (18:10 +0000)
committerRussell Coker <russell@coker.com.au>
Fri, 11 Jan 2002 18:10:16 +0000 (18:10 +0000)
also fixed a trivial memory leak.

pppd/main.c

index 03e1d8f6eee7f7174863427e96d8a28e6781e8b7..6541a3be3c472d208f43059ba8f74e3f88431425 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: main.c,v 1.108 2001/12/14 02:51:34 mostrows Exp $"
+#define RCSID  "$Id: main.c,v 1.109 2002/01/11 18:10:16 etbe Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -1583,7 +1583,8 @@ reap_kids(waitfor)
                 (chp? chp->prog: "??"), pid, WTERMSIG(status));
        } else if (debug)
            dbglog("Script %s finished (pid %d), status = 0x%x",
                 (chp? chp->prog: "??"), pid, WTERMSIG(status));
        } else if (debug)
            dbglog("Script %s finished (pid %d), status = 0x%x",
-                  (chp? chp->prog: "??"), pid, status);
+                  (chp? chp->prog: "??"), pid,
+                  WIFEXITED(status) ? WEXITSTATUS(status) : status);
        if (chp && chp->done)
            (*chp->done)(chp->arg);
        if (chp)
        if (chp && chp->done)
            (*chp->done)(chp->arg);
        if (chp)
@@ -1786,6 +1787,9 @@ update_db_entry()
     if (tdb_store(pppdb, key, dbuf, TDB_REPLACE))
        error("tdb_store failed: %s", tdb_error(pppdb));
 
     if (tdb_store(pppdb, key, dbuf, TDB_REPLACE))
        error("tdb_store failed: %s", tdb_error(pppdb));
 
+    if (vbuf)
+        free(vbuf);
+
 }
 
 /*
 }
 
 /*