The third grab bag of ANSI-fication, warning removal, and comment fixes. --- pbs-2.3.12/Makefile.in | 4 ++-- pbs-2.3.12/src/include/mom_func.h | 1 + pbs-2.3.12/src/resmom/linux/mom_mach.c | 5 +++-- pbs-2.3.12/src/resmom/mom_comm.c | 25 +++++++++---------------- pbs-2.3.12/src/resmom/mom_main.c | 5 ++--- pbs-2.3.12/src/server/accounting.c | 5 +++-- pbs-2.3.12/src/server/attr_recov.c | 4 +--- pbs-2.3.12/src/server/job_recov.c | 1 + 8 files changed, 22 insertions(+), 28 deletions(-) diff -puN Makefile.in~compile-warning-fixes-3 Makefile.in --- pbs-2.3.12-orig/Makefile.in~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/Makefile.in 2004-08-06 17:52:02.000000000 -0400 @@ -95,7 +95,7 @@ MK_VPATH = @srcdir@ all build depend install clean distclean:: @# do the distclean here so the sequencing can be assured @# allow for empty subdir lists and abort make if any subdir fails - @if test $@ = all || $@ = build; then \ + @if test $@ = all || test $@ = build; then \ cd doc; $(MAKE) soelim ; fi @case $@ in \ *clean) SDIRS="src buildutils doc";; \ @@ -107,7 +107,7 @@ all build depend install clean distclean else true; fi; \ done && \ { test $@ = distclean && \ - ($(RM) Makefile config.*; exit 0) > /dev/null 2>&1 || true; } + ($(RM) Makefile config.* tags ; exit 0) > /dev/null 2>&1 || true; } # diff -puN src/include/mom_func.h~compile-warning-fixes-3 src/include/mom_func.h --- pbs-2.3.12-orig/src/include/mom_func.h~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/include/mom_func.h 2004-08-06 17:52:02.000000000 -0400 @@ -166,6 +166,7 @@ extern int task_save(task *ptask); extern void end_proc(void); extern int message_job(job *pjob, enum job_file jft, char *text); extern void term_job(job *pjob); +extern struct passwd *check_pwd(job *pjob); /* Defines for pe_io_type, see run_pelog() */ diff -puN src/resmom/linux/mom_mach.c~compile-warning-fixes-3 src/resmom/linux/mom_mach.c --- pbs-2.3.12-orig/src/resmom/linux/mom_mach.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/resmom/linux/mom_mach.c 2004-08-06 17:52:02.000000000 -0400 @@ -84,6 +84,7 @@ #include #include #include +#include /* kill */ #include #include #include @@ -451,8 +452,8 @@ injob(pjob, sid) * consumed for all tasks executed by the job, in seconds, * adjusted by cputfactor. */ -static unsigned long cput_sum(pjob) - job *pjob; +static unsigned long +cput_sum(job *pjob) { char *id = "cput_ses"; int fd; diff -puN src/resmom/mom_comm.c~compile-warning-fixes-3 src/resmom/mom_comm.c --- pbs-2.3.12-orig/src/resmom/mom_comm.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/resmom/mom_comm.c 2004-08-06 17:52:02.000000000 -0400 @@ -298,10 +298,8 @@ task_find(pjob, taskid) } -task * -task_check(pjob, taskid) - job *pjob; - tm_task_id taskid; +static task * +task_check(job *pjob, tm_task_id taskid) { static char id[] = "task_check"; task *ptask; @@ -834,10 +832,8 @@ im_eof(stream, ret) ** Set the stream in ji_nodes[0] if needed. ** Return TRUE on error, FALSE if okay. */ -int -check_ms(stream, pjob) - int stream; - job *pjob; +static int +check_ms(int stream, job *pjob) { static char id[] = "check_ms"; struct sockaddr_in *addr; @@ -1023,9 +1019,7 @@ resc_string(pjob) ** Format the reply and write it back. */ void -im_request(stream, version) - int stream; - int version; +im_request(int stream, int version) { char *id = "im_request"; int command = 0; @@ -1060,7 +1054,6 @@ im_request(stream, version) list_head lhead; svrattrl *psatl; attribute_def *pdef; - struct passwd *check_pwd(); extern int resc_access_perm; int start_process A_((task *pt, char **argv, char **envp)); u_long gettime A_((resource *pres)); @@ -1216,7 +1209,7 @@ im_request(stream, version) pjob->ji_qs.ji_un.ji_newt.ji_fromaddr = addr->sin_addr.s_addr; pjob->ji_qs.ji_un.ji_newt.ji_scriptsz = 0; - if (check_pwd(pjob) == (struct passwd *)0) { + if (!check_pwd(pjob)) { LOG_EVENT(PBSEVENT_JOB, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, log_buffer); (void)job_purge(pjob); @@ -1313,7 +1306,7 @@ im_request(stream, version) ep = (eventent *)GET_NEXT(ep->ee_next); } if (ep == NULL) { - sprintf(log_buffer, "event %d taskid %ld not found", + sprintf(log_buffer, "event %d taskid %u not found", event, fromtask); log_err(-1, id, log_buffer); goto err; @@ -2384,7 +2377,7 @@ tm_request(fd, version) ptask = task_find(pjob, fromtask); if (ptask == NULL) { /* not found */ sprintf(log_buffer, - "task %ld in job %s not found", + "task %d in job %s not found", fromtask, jobid); log_err(-1, id, log_buffer); ret = tm_reply(fd, TM_ERROR, event); @@ -2398,7 +2391,7 @@ tm_request(fd, version) else if (ptask->ti_fd != -1 && ptask->ti_fd != fd) { /* we should have a new fd or match the old */ sprintf(log_buffer, - "extra TM connect from %s task %ld", + "extra TM connect from %s task %d", jobid, fromtask); log_err(-1, id, log_buffer); goto err; diff -puN src/resmom/mom_main.c~compile-warning-fixes-3 src/resmom/mom_main.c --- pbs-2.3.12-orig/src/resmom/mom_main.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/resmom/mom_main.c 2004-08-06 17:52:02.000000000 -0400 @@ -1380,9 +1380,8 @@ bad: ** Read a RPP message from a stream, figure out if it is a ** Resource Monitor request or an InterMom message. */ -void -do_rpp(stream) - int stream; +static void +do_rpp(int stream) { static char id[] = "do_rpp"; int ret, proto, version; diff -puN src/server/accounting.c~compile-warning-fixes-3 src/server/accounting.c --- pbs-2.3.12-orig/src/server/accounting.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/server/accounting.c 2004-08-06 17:52:02.000000000 -0400 @@ -96,6 +96,7 @@ static char ident[] = "@(#) $RCSfile: ac #include #include #include +#include #include #include "list_link.h" #include "attribute.h" @@ -176,7 +177,7 @@ static char *acct_job(pjob, pb) pb += strlen(pb); /* execution start time */ - (void)sprintf(pb, "start=%d ", pjob->ji_qs.ji_stime); + (void)sprintf(pb, "start=%ld ", pjob->ji_qs.ji_stime); pb += strlen(pb); /* execution host name */ @@ -348,7 +349,7 @@ void account_jobend(pjob, used) } /* add the execution ended time */ - (void)sprintf(pb, "end=%d ", time_now); + (void)sprintf(pb, "end=%ld ", time_now); pb += strlen(pb); /* finally add on resources used from req_jobobit() */ diff -puN src/server/attr_recov.c~compile-warning-fixes-3 src/server/attr_recov.c --- pbs-2.3.12-orig/src/server/attr_recov.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/server/attr_recov.c 2004-08-06 17:52:02.000000000 -0400 @@ -127,10 +127,8 @@ static size_t spaceused; /* amount of s * the file descriptor, and the space in the buffer. */ -void save_setup(fds) - int fds; /* file descriptor to use for save */ +void save_setup(int fds) /* fds = file descriptor to use for save */ { - if (pkbfds != -2) { /* somebody forgot to flush the buffer */ log_err(-1, "save_setup", "someone forgot to flush"); } diff -puN src/server/job_recov.c~compile-warning-fixes-3 src/server/job_recov.c --- pbs-2.3.12-orig/src/server/job_recov.c~compile-warning-fixes-3 2004-08-06 17:52:02.000000000 -0400 +++ pbs-2.3.12/src/server/job_recov.c 2004-08-06 17:52:02.000000000 -0400 @@ -94,6 +94,7 @@ #include "pbs_ifl.h" #include #include +#include #include #include #include _