From 215baf28fc53e909b987a4b31d7d25ecd4ee7a71 Mon Sep 17 00:00:00 2001 From: Russell Coker Date: Fri, 11 Jan 2002 18:10:16 +0000 Subject: [PATCH] Made the exit return code be reported via WEXITSTATUS(status) instead of status, also fixed a trivial memory leak. --- pppd/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pppd/main.c b/pppd/main.c index 03e1d8f..6541a3b 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * 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 #include @@ -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, status); + (chp? chp->prog: "??"), pid, + WIFEXITED(status) ? WEXITSTATUS(status) : status); 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 (vbuf) + free(vbuf); + } /* -- 2.39.2