diff options
author | brian <brian@FreeBSD.org> | 1998-10-27 22:53:19 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-10-27 22:53:19 +0000 |
commit | 2b23dbce042044ec20c571600164b14b7d6d6543 (patch) | |
tree | bdeb7ad8bbc3f25a037e5cd93ac55ffbe235b6b2 /usr.sbin/ppp/command.c | |
parent | 40a2b1778b61c894df92557398afb05e0fc9799c (diff) | |
download | FreeBSD-src-2b23dbce042044ec20c571600164b14b7d6d6543.zip FreeBSD-src-2b23dbce042044ec20c571600164b14b7d6d6543.tar.gz |
Add ``PROCESSID'' as a constant expanded when running
commands.
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r-- | usr.sbin/ppp/command.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 2e432ff..a45ab3c 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.171 1998/10/26 19:07:39 brian Exp $ + * $Id: command.c,v 1.172 1998/10/26 19:07:42 brian Exp $ * */ #include <sys/types.h> @@ -134,7 +134,7 @@ #define NEG_DNS 50 const char Version[] = "2.0"; -const char VersionDate[] = "$Date: 1998/10/26 19:07:39 $"; +const char VersionDate[] = "$Date: 1998/10/26 19:07:42 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -384,8 +384,10 @@ static void expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle) { int arg; + char pid[12]; nargv[0] = strdup(oargv[0]); + snprintf(pid, sizeof pid, "%d", getpid()); for (arg = 1; arg < argc; arg++) { nargv[arg] = strdup(oargv[arg]); nargv[arg] = subst(nargv[arg], "HISADDR", @@ -402,6 +404,7 @@ expand(char **nargv, int argc, char const *const *oargv, struct bundle *bundle) mp_Enddisc(bundle->ncp.mp.cfg.enddisc.class, bundle->ncp.mp.cfg.enddisc.address, bundle->ncp.mp.cfg.enddisc.len)); + nargv[arg] = subst(nargv[arg], "PROCESSID", pid); nargv[arg] = subst(nargv[arg], "LABEL", bundle_GetLabel(bundle)); } nargv[arg] = NULL; |