version 1.27, 2000/06/10 01:32:22 |
version 1.28, 2000/06/10 01:41:05 |
|
|
#define W_SETEXITSTATUS(st, val) W_SETMASKED(st, val, WEXITSTATUS) |
#define W_SETEXITSTATUS(st, val) W_SETMASKED(st, val, WEXITSTATUS) |
|
|
|
|
static void JobCondPassSig __P((ClientData, ClientData)); |
static void JobCondPassSig __P((void *, void *)); |
static void JobPassSig __P((int)); |
static void JobPassSig __P((int)); |
static int JobCmpPid __P((ClientData, ClientData)); |
static int JobCmpPid __P((void *, void *)); |
static int JobPrintCommand __P((ClientData, ClientData)); |
static int JobPrintCommand __P((void *, void *)); |
static void JobSaveCommand __P((ClientData, ClientData)); |
static void JobSaveCommand __P((void *, void *)); |
static void JobClose __P((Job *)); |
static void JobClose __P((Job *)); |
#ifdef REMOTE |
#ifdef REMOTE |
static int JobCmpRmtID __P((Job *, ClientData)); |
static int JobCmpRmtID __P((Job *, void *)); |
# ifdef RMT_WILL_WATCH |
# ifdef RMT_WILL_WATCH |
static void JobLocalInput __P((int, Job *)); |
static void JobLocalInput __P((int, Job *)); |
# endif |
# endif |
|
|
*/ |
*/ |
static void |
static void |
JobCondPassSig(jobp, signop) |
JobCondPassSig(jobp, signop) |
ClientData jobp; /* Job to biff */ |
void *jobp; /* Job to biff */ |
ClientData signop; /* Signal to send it */ |
void *signop; /* Signal to send it */ |
{ |
{ |
Job *job = (Job *) jobp; |
Job *job = (Job *) jobp; |
int signo = *(int *) signop; |
int signo = *(int *) signop; |
|
|
*/ |
*/ |
static int |
static int |
JobCmpPid(job, pid) |
JobCmpPid(job, pid) |
ClientData job; /* job to examine */ |
void *job; /* job to examine */ |
ClientData pid; /* process id desired */ |
void *pid; /* process id desired */ |
{ |
{ |
return *(int *) pid - ((Job *) job)->pid; |
return *(int *)pid - ((Job *)job)->pid; |
} |
} |
|
|
#ifdef REMOTE |
#ifdef REMOTE |
|
|
*/ |
*/ |
static int |
static int |
JobCmpRmtID(job, rmtID) |
JobCmpRmtID(job, rmtID) |
ClientData job; /* job to examine */ |
void *job; /* job to examine */ |
ClientData rmtID; /* remote id desired */ |
void *rmtID; /* remote id desired */ |
{ |
{ |
return *(int *) rmtID - *(int *) job->rmtID; |
return *(int *) rmtID - *(int *) job->rmtID; |
} |
} |
|
|
*/ |
*/ |
static int |
static int |
JobPrintCommand(cmdp, jobp) |
JobPrintCommand(cmdp, jobp) |
ClientData cmdp; /* command string to print */ |
void *cmdp; /* command string to print */ |
ClientData jobp; /* job for which to print it */ |
void *jobp; /* job for which to print it */ |
{ |
{ |
Boolean noSpecials; /* true if we shouldn't worry about |
Boolean noSpecials; /* true if we shouldn't worry about |
* inserting special commands into |
* inserting special commands into |
|
|
*/ |
*/ |
static void |
static void |
JobSaveCommand(cmd, gn) |
JobSaveCommand(cmd, gn) |
ClientData cmd; |
void *cmd; |
ClientData gn; |
void *gn; |
{ |
{ |
cmd = (ClientData) Var_Subst((char *) cmd, (GNode *) gn, FALSE); |
char *result; |
Lst_AtEnd(postCommands->commands, cmd); |
|
|
result = Var_Subst((char *)cmd, (GNode *)gn, FALSE); |
|
Lst_AtEnd(postCommands->commands, result); |
} |
} |
|
|
|
|
|
|
Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node); |
Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node); |
job->node->made = MADE; |
job->node->made = MADE; |
Make_Update(job->node); |
Make_Update(job->node); |
free((Address)job); |
free(job); |
} else if (*status != 0) { |
} else if (*status != 0) { |
errors += 1; |
errors += 1; |
free((Address)job); |
free(job); |
} |
} |
|
|
JobRestartJobs(); |
JobRestartJobs(); |
|
|
Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node); |
Lst_ForEachFrom(job->tailCmds, JobSaveCommand, job->node); |
Make_Update(job->node); |
Make_Update(job->node); |
} |
} |
free((Address)job); |
free(job); |
return(JOB_FINISHED); |
return JOB_FINISHED; |
} else { |
} else { |
free((Address)job); |
free(job); |
return(JOB_ERROR); |
return JOB_ERROR; |
} |
} |
} else { |
} else { |
(void) fflush(job->cmdFILE); |
(void) fflush(job->cmdFILE); |
|
|
|
|
words = brk_string(line, &wordCount, TRUE, &shellArgv); |
words = brk_string(line, &wordCount, TRUE, &shellArgv); |
|
|
memset((Address)&newShell, 0, sizeof(newShell)); |
memset(&newShell, 0, sizeof(newShell)); |
|
|
/* |
/* |
* Parse the specification by keyword |
* Parse the specification by keyword |