Fix some of the syntax errors (in unused code) and layout glitches.

This commit is contained in:
pk 2002-03-18 13:32:36 +00:00
parent b9f8785382
commit 48f5b2bd9d
1 changed files with 16 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: job.c,v 1.69 2002/03/18 13:28:25 pk Exp $ */ /* $NetBSD: job.c,v 1.70 2002/03/18 13:32:36 pk Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California. * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -39,14 +39,14 @@
*/ */
#ifdef MAKE_BOOTSTRAP #ifdef MAKE_BOOTSTRAP
static char rcsid[] = "$NetBSD: job.c,v 1.69 2002/03/18 13:28:25 pk Exp $"; static char rcsid[] = "$NetBSD: job.c,v 1.70 2002/03/18 13:32:36 pk Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
#if 0 #if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else #else
__RCSID("$NetBSD: job.c,v 1.69 2002/03/18 13:28:25 pk Exp $"); __RCSID("$NetBSD: job.c,v 1.70 2002/03/18 13:32:36 pk Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -317,7 +317,7 @@ static int JobPrintCommand __P((ClientData, ClientData));
static int JobSaveCommand __P((ClientData, ClientData)); static int JobSaveCommand __P((ClientData, ClientData));
static void JobClose __P((Job *)); static void JobClose __P((Job *));
#ifdef REMOTE #ifdef REMOTE
static int JobCmpRmtID __P((Job *, int)); static int JobCmpRmtID __P((ClientData, ClientData));
# ifdef RMT_WILL_WATCH # ifdef RMT_WILL_WATCH
static void JobLocalInput __P((int, Job *)); static void JobLocalInput __P((int, Job *));
# endif # endif
@ -573,7 +573,7 @@ JobCmpRmtID(job, rmtID)
ClientData job; /* job to examine */ ClientData job; /* job to examine */
ClientData rmtID; /* remote id desired */ ClientData rmtID; /* remote id desired */
{ {
return(*(int *) rmtID - *(int *) job->rmtID); return(*(int *) rmtID - ((Job *) job)->rmtID);
} }
#endif #endif
@ -1606,7 +1606,7 @@ JobRestart(job)
#else #else
job->flags &= ~(JOB_REMIGRATE|JOB_RESUME); job->flags &= ~(JOB_REMIGRATE|JOB_RESUME);
#endif #endif
} else { } else {
/* /*
* Job cannot be restarted. Mark the table as full and * Job cannot be restarted. Mark the table as full and
* place the job back on the list of stopped jobs. * place the job back on the list of stopped jobs.
@ -1655,13 +1655,14 @@ JobRestart(job)
(void) fflush(stdout); (void) fflush(stdout);
} }
#ifdef REMOTE #ifdef REMOTE
if ((job->node->type&OP_NOEXPORT) || if ((job->node->type & OP_NOEXPORT) ||
(nLocal < maxLocal && runLocalFirst) (nLocal < maxLocal && runLocalFirst)
# ifdef RMT_NO_EXEC # ifdef RMT_NO_EXEC
|| !Rmt_Export(shellPath, argv, job) || !Rmt_Export(shellPath, argv, job)
# else # else
|| !Rmt_Begin(shellPath, argv, job->node) || !Rmt_Begin(shellPath, argv, job->node)
# endif # endif
)
#endif #endif
{ {
if (((nLocal >= maxLocal) && !(job->flags & JOB_SPECIAL))) { if (((nLocal >= maxLocal) && !(job->flags & JOB_SPECIAL))) {
@ -1708,17 +1709,15 @@ JobRestart(job)
(void) fprintf(stdout, "Resuming %s...", job->node->name); (void) fprintf(stdout, "Resuming %s...", job->node->name);
(void) fflush(stdout); (void) fflush(stdout);
} }
if (((job->flags & JOB_REMOTE) || if ((nJobs != maxJobs) &&
(nLocal < maxLocal) || ((job->flags & JOB_REMOTE) ||
(nLocal < maxLocal) ||
((maxLocal == 0) &&
((job->flags & JOB_SPECIAL)
#ifdef REMOTE #ifdef REMOTE
(((job->flags & JOB_SPECIAL) && && (job->node->type & OP_NOEXPORT)
(job->node->type & OP_NOEXPORT)) &&
(maxLocal == 0))) &&
#else
((job->flags & JOB_SPECIAL) &&
(maxLocal == 0))) &&
#endif #endif
(nJobs != maxJobs)) ))))
{ {
/* /*
* If the job is remote, it's ok to resume it as long as the * If the job is remote, it's ok to resume it as long as the
@ -3246,7 +3245,7 @@ JobFlagForMigration(hostID)
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID); (void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
(void) fflush(stdout); (void) fflush(stdout);
} }
jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID); jnode = Lst_Find(jobs, (ClientData)&hostID, JobCmpRmtID);
if (jnode == NILLNODE) { if (jnode == NILLNODE) {
jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID); jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID);