Commit 64fe3bdf authored by Leigh Stoller's avatar Leigh Stoller

Minor fix for operating within virtual nodes; lok for TMCCVNODEID env

variable and pass along as argument to tmcc.
parent 612c13e3
......@@ -19,19 +19,29 @@
int
tmcc(char *fmt, char *ret, int retlen, ...)
{
char buf[2*BUFSIZ], *bp = ret;
char buf[2*BUFSIZ], *bp = ret, *ep;
va_list ap;
FILE *fp;
int retval = 0;
int count = 0;
/* See if this is inside a vnode */
if ((ep = getenv("TMCCVNODEID")) == NULL)
ep = "";
/* Need to tack on the path to tmcc */
if (strlen(TMCC) + strlen(fmt) + 1 > sizeof(buf)) {
if (strlen(TMCC) + strlen(fmt) + strlen(ep) + 10 > sizeof(buf)) {
errno = ENOMEM;
return -1;
}
strcpy(buf, TMCC);
strcat(buf, " ");
if (strlen(ep)) {
strcat(buf, "-n ");
strcat(buf, ep);
strcat(buf, " ");
}
strcat(buf, fmt);
va_start(ap, retlen);
......
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2002, 2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -30,6 +30,10 @@ else
exit 1;
fi
# Pass this along for tmcc clients.
TMCCVNODEID=$VNODEID
export TMCCVNODEID
# See how we were called.
case "$1" in
start)
......
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