Commit 1b208ab0 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Restore the old functionality with a minor change; COMMAND is now

optional when using tevc (dynamic events). So:

	tevc -e testbed/progagents now prog0 start

will simply rerun whatever the last command was.
parent c78e9c71
......@@ -20,6 +20,7 @@
#include <arpa/inet.h>
#include <signal.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include "tbdefs.h"
#include "log.h"
......@@ -343,6 +344,18 @@ start_program(struct proginfo *pinfo, char *args)
pinfo->pid = 0;
}
/*
* The args string holds the command line to execute. We allow
* this to be reset in dynamic events, but is optional; the cuurent
* command will be used by default, which initially comes from tmcd.
*/
if (args && strlen(args) &&
!strncmp("COMMAND=", args, strlen("COMMAND="))) {
if (pinfo->cmdline)
free(pinfo->cmdline);
pinfo->cmdline = strdup(&args[strlen("COMMAND=")]);
}
/*
* Fork a child to run the command in and return to get
* more events.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment