cmdname = (char *)basename(args[0]);
cmdname = basename(args[0]);
int runCommand(char *cmd, int reexec, int quiet, int debug) {    int fds[2];    int pid,x;    char **args, **tmpargs;    char *cmdname;        poptParseArgvString(cmd,&x,&tmpargs);    args = malloc((x+1)*sizeof(char *));    for ( pid = 0; pid < x ; pid++) {	args[pid] = strdup(tmpargs[pid]);    }    args[pid] = NULL;    if (strcmp(args[0],"sh") && strcmp(args[0],"/bin/sh"))       cmdname = (char *)basename(args[0]);    else      cmdname = (char *)basename(args[1]);    if ((cmdname[0] =='K' || cmdname[0] == 'S') && ( '0' <= cmdname[1] <= '9' )       && ( '0' <= cmdname[2] <= '9' ) )      cmdname+=3;    if (!reexec) {       pid=forkCommand(args,&fds[0],&fds[1],NULL,quiet);       x=monitor(cmdname,pid,2,fds,reexec,quiet,debug);    } else {       setenv("IN_INITLOG","yes",1);       pid=forkCommand(args,NULL,NULL,&fds[0],quiet);       unsetenv("IN_INITLOG");       x=monitor(cmdname,pid,1,&fds[0],reexec,quiet,debug);    }    return x;}