diff --git a/.gitignore b/.gitignore index de2f01ec0d..2a6c920383 100644 --- a/.gitignore +++ b/.gitignore @@ -446,6 +446,7 @@ cscope.out *.orig *.rej *.patch +coverage_results.file tmpdiff tmpfile tmporig diff --git a/Makefile.am b/Makefile.am index c74eb44093..64a0b53664 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = acinclude.m4 \ INSTALL \ INSTALL.GNU \ Makefile.am \ - parse_cov_results.pl \ + parse_cov_results.py \ PBS_License.txt \ README.array_changes \ README.coding_notes \ @@ -24,7 +24,7 @@ EXTRA_DIST = acinclude.m4 \ README.trqauthd \ README.building_40 \ Release_Notes \ - run_report.pl \ + run_report.py \ torque.setup \ torque.spec \ buildutils/config.mk \ diff --git a/buildutils/torque.spec.in b/buildutils/torque.spec.in index 984c25319a..31f2f56898 100644 --- a/buildutils/torque.spec.in +++ b/buildutils/torque.spec.in @@ -16,6 +16,7 @@ ### Features disabled by default %bcond_with blcr %bcond_with cpuset +%bcond_with debug %bcond_with drmaa %bcond_with gui %bcond_with libcpuset @@ -33,6 +34,7 @@ ### Autoconf macro expansions %define ac_with_blcr --%{?with_blcr:en}%{!?with_blcr:dis}able-blcr %define ac_with_cpuset --%{?with_cpuset:en}%{!?with_cpuset:dis}able-cpuset +%define ac_with_debug --with%{!?with_debug:out}-debug CFLAGS="-O0 -g3" %define ac_with_drmaa --%{?with_drmaa:en}%{!?with_drmaa:dis}able-drmaa %define ac_with_gui --%{?with_gui:en}%{!?with_gui:dis}able-gui --with%{!?with_gui:out}-tcl %define ac_with_munge --%{?with_munge:en}%{!?with_munge:dis}able-munge-auth @@ -57,18 +59,22 @@ %{!?torque_server:%global torque_server localhost} %{!?sendmail_path:%global sendmail_path %{_sbindir}/sendmail} -### Do not strip executables -#define __os_install_post /usr/lib/rpm/brp-compress +### Do not strip executables when debugging. +%if %{with debug} +%global __os_install_post /usr/lib/rpm/brp-compress +%global __debug_install_post %{nil} +%global debug_package %{nil} +%endif ### Handle logic for snapshots %define tarversion @SPEC_VERSION@ #define snap 0 %if %{?snap}0 %{expand:%%define version %(echo %{tarversion} | sed 's/-snap\..*$//')} -%{expand:%%define release 0.cri.snap.%(echo %{tarversion} | sed 's/^.*-snap\.//')} +%{expand:%%define release 0.adaptive.snap.%(echo %{tarversion} | sed 's/^.*-snap\.//').0%{?dist}} %else %define version %{tarversion} -%define release 1.cri +%define release 1.adaptive%{?dist} %endif Name: @SPEC_NAME@ @@ -172,7 +178,8 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}" export CFLAGS CXXFLAGS %configure --includedir=%{_includedir}/%{name} --with-default-server=%{torque_server} \ - --with-server-home=%{torque_home} --with-sendmail=%{sendmail_path} \ + --with-server-home=%{torque_home} %{ac_with_debug} %{ac_with_libcpuset} \ + --with-sendmail=%{sendmail_path} %{ac_with_numa} %{ac_with_memacct} %{ac_with_top} \ --disable-dependency-tracking %{ac_with_gui} %{ac_with_scp} %{ac_with_syslog} \ --disable-gcc-warnings %{ac_with_munge} %{ac_with_pam} %{ac_with_drmaa} \ --disable-qsub-keep-override %{ac_with_blcr} %{ac_with_cpuset} %{ac_with_spool} %{?acflags} diff --git a/configure.ac b/configure.ac index 32f3df5e9f..e8982fa57e 100644 --- a/configure.ac +++ b/configure.ac @@ -718,10 +718,10 @@ AC_CHECK_LIB(crypto, BN_init, dnl dnl we need libxml2 dnl -xmlLib=`xml2-config --libs` +xmlLib=`xml2-config --libs | sed 's/-L@<:@^@<:@:space:@:>@@:>@* //g;s/-l//'` dnl skip the first two chars because its -l -AC_CHECK_LIB(${xmlLib:2}, xmlGetProp, +AC_CHECK_LIB(${xmlLib}, xmlGetProp, [], [AC_MSG_ERROR([TORQUE needs libxml2-devel in order to build]) ]) diff --git a/cov_file_results.pl b/cov_file_results.py similarity index 100% rename from cov_file_results.pl rename to cov_file_results.py diff --git a/parse_cov_results.pl b/parse_cov_results.py similarity index 100% rename from parse_cov_results.pl rename to parse_cov_results.py diff --git a/run_report.pl b/run_report.py similarity index 85% rename from run_report.pl rename to run_report.py index eee2d93e1d..ea1e207053 100755 --- a/run_report.pl +++ b/run_report.py @@ -18,9 +18,9 @@ print " Individual file code coverage and a Total"; print "----------------------------------------------------------------------------"; print coverage_file; - parse_res=Popen(["./parse_cov_results.pl", coverage_file]); + parse_res=Popen(["./parse_cov_results.py", coverage_file]); res=parse_res.communicate(); - file_res=Popen(["./cov_file_results.pl"]); + file_res=Popen(["./cov_file_results.py"]); res=file_res.communicate(); if __name__ == "__main__": diff --git a/src/cmds/pbspoe.c b/src/cmds/pbspoe.c index a113d176a2..47ae695691 100644 --- a/src/cmds/pbspoe.c +++ b/src/cmds/pbspoe.c @@ -551,7 +551,6 @@ void run_command( char *argv[]) { - int junk = 0; int i; char *psyscmd; int syssz; @@ -599,7 +598,10 @@ void run_command( strcat(psyscmd, argv[i++]); } - junk = system(psyscmd); + if(system(psyscmd) == -1) + { + fprintf(stderr, "Error, system of %s failed\n",psyscmd); + } clean_up(0); } diff --git a/src/cmds/qsub_functions.c b/src/cmds/qsub_functions.c index f66da094ce..58c6978c6a 100644 --- a/src/cmds/qsub_functions.c +++ b/src/cmds/qsub_functions.c @@ -4055,8 +4055,8 @@ void main_func( { - int errflg; /* option error */ - char script[MAXPATHLEN + 1] = ""; /* name of script file */ + int errflg; /* option error */ + char script[MAXPATHLEN + 1] = ""; /* name of script file */ char script_tmp[MAXPATHLEN + 1] = ""; /* name of script file copy */ int script_index; char *bnp; diff --git a/src/cmds/test/common_cmds/test_common_cmds.c b/src/cmds/test/common_cmds/test_common_cmds.c index d9e3daf74f..74a69f058a 100644 --- a/src/cmds/test/common_cmds/test_common_cmds.c +++ b/src/cmds/test/common_cmds/test_common_cmds.c @@ -22,6 +22,7 @@ START_TEST(test_parse_env_line_nospace) fail_unless(val != NULL, "val should have a value"); fail_unless(strcmp("ONE_VAR", name) == 0, "[ONE_VAR] != [%s]", name); fail_unless(strcmp("THE_VAL", val) == 0, "[THE_VAL] != [%s]", val); + fail_unless(rc == 0); } END_TEST @@ -36,6 +37,7 @@ START_TEST(test_parse_env_line_space) fail_unless(val != NULL, "val should have a value"); fail_unless(strcmp("ONE_VAR", name) == 0, "[ONE_VAR] != [%s]", name); fail_unless(strcmp("THE_VAL", val) == 0, "[THE_VAL] != [%s]", val); + fail_unless(rc == 0); } END_TEST @@ -50,12 +52,13 @@ START_TEST(test_parse_env_line_allspace) fail_unless(val != NULL, "val should have a value"); fail_unless(strcmp("ONE_VAR", name) == 0, "[ONE_VAR] != [%s]", name); fail_unless(strcmp(" ", val) == 0, "[ ] != [%s]", val); + fail_unless(rc == 0); } END_TEST START_TEST(test_set_env_opts) { - char *env_var[4]; + char *env_var[5]; job_data *env_hash = NULL; memmgr *mm; tc_num = 1; @@ -157,7 +160,7 @@ void rundebug() /* strcpy(env_var[2], "FOUR_VAR="); */ /* strcpy(env_var[3], "_=CMD"); */ /* set_env_opts(&env_hash, env_var); */ - char *env_var[4]; + char *env_var[5]; job_data *env_hash = NULL; memmgr *mm; tc_num = 1; diff --git a/src/cmds/test/qsub_functions/test_x11_get_proto.c b/src/cmds/test/qsub_functions/test_x11_get_proto.c index 37ef23f8d3..c9e92d03c5 100644 --- a/src/cmds/test/qsub_functions/test_x11_get_proto.c +++ b/src/cmds/test/qsub_functions/test_x11_get_proto.c @@ -8,6 +8,7 @@ START_TEST(test_x11_get_proto_1) char *resp = NULL; int debug = 1; resp = x11_get_proto(param1, debug); + fail_unless(resp == NULL); } END_TEST diff --git a/src/lib/Libsite/test/site_alt_rte/test_site_alt_rte.c b/src/lib/Libsite/test/site_alt_rte/test_site_alt_rte.c index 98fd9903d9..20464e14d8 100644 --- a/src/lib/Libsite/test/site_alt_rte/test_site_alt_rte.c +++ b/src/lib/Libsite/test/site_alt_rte/test_site_alt_rte.c @@ -25,6 +25,7 @@ START_TEST(test_one) fail_unless(pjob == scaf_pjob, "job ptr changed in the function!!!!"); fail_unless(qp == scaf_qp, "queue ptr changed in the function!!!!"); fail_unless(retry_time == scaf_retry_time, "retry value changed in the function!!!!"); + fail_unless(rc != 0); free(pjob); free(qp); } diff --git a/src/lib/Libutils/test/u_memmgr/test_u_memmgr.c b/src/lib/Libutils/test/u_memmgr/test_u_memmgr.c index 611830cca6..40482f049f 100644 --- a/src/lib/Libutils/test/u_memmgr/test_u_memmgr.c +++ b/src/lib/Libutils/test/u_memmgr/test_u_memmgr.c @@ -113,6 +113,7 @@ START_TEST(test_memmgr_calloc_shuffle_shuffle_extend) fail_unless(ptr == NULL, "zero memory request should generate NULL ptr response"); rc = memmgr_init(&mm, 48); + fail_unless(rc == 0); data_ptr1 = (char *)memmgr_calloc(&mm, 1, 5); strcpy(data_ptr1, "11111"); data_ptr2 = (char *)memmgr_calloc(&mm, 1, 6); @@ -192,6 +193,7 @@ START_TEST(test_memmgr_free_remove) memmgr *mm = NULL; init_globals(); rc = memmgr_init(&mm, 48); + fail_unless(rc == 0); data_ptr1 = (char *)memmgr_calloc(&mm, 1, 5); strcpy(data_ptr1, "11111"); data_ptr2 = (char *)memmgr_calloc(&mm, 1, 6); @@ -209,6 +211,7 @@ START_TEST(test_memmgr_free_remove) mptr3 = mm->next_mgr->next_mgr; mptr4 = mm->next_mgr->next_mgr->next_mgr; + fail_unless(mptr2 == mm->next_mgr); memmgr_free(&mm, data_ptr1); fail_unless(mptr3->ref_count == 2, "ref_count after free should be 2 but is:%d", mm->ref_count); memcpy(&size, mptr3->the_mem, sizeof(int)); @@ -262,10 +265,12 @@ START_TEST(test_memmgr_realloc) fail_unless(memmgr_realloc(NULL, NULL, 5) == NULL, "NULL memmgr should result in NULL ptr"); fail_unless(memmgr_realloc(&mm, NULL, 5) == NULL, "NULL memmgr should result in NULL ptr"); rc = memmgr_init(&mm, 48); + fail_unless(rc == 0); fail_unless(memmgr_realloc(&mm, NULL, -1) == NULL, "negative size should result in NULL ptr"); fail_unless(memmgr_realloc(&mm, NULL, 5) != NULL, "NULL ptr with valid size should result in valid ptr"); memmgr_destroy(&mm); rc = memmgr_init(&mm, 48); + fail_unless(rc == 0); data_ptr1 = (char *)memmgr_calloc(&mm, 1, 11); strcpy(data_ptr1, "11111111111"); ptr = (char *)mm->current_pos; @@ -342,6 +347,7 @@ void rundebug() memmgr *mm = NULL; init_globals(); rc = memmgr_init(&mm, 48); + fail_unless(rc == 0); data_ptr1 = (char *)memmgr_calloc(&mm, 1, 11); strcpy(data_ptr1, "11111111111"); data_ptr2 = (char *)memmgr_realloc(&mm, data_ptr1, 4); @@ -355,6 +361,7 @@ void rundebug() data_ptr5 = (char *)memmgr_realloc(&mm, data_ptr4, 20); memset(data_ptr5, '5', 6); data_ptr6 = (char *)memmgr_realloc(&mm, data_ptr2, 50); + fail_unless(data_ptr6 != NULL); memmgr_destroy(&mm); } diff --git a/src/lib/Libutils/test/u_users/test_u_users.c b/src/lib/Libutils/test/u_users/test_u_users.c index b9556247d8..0d783e25bb 100644 --- a/src/lib/Libutils/test/u_users/test_u_users.c +++ b/src/lib/Libutils/test/u_users/test_u_users.c @@ -71,9 +71,11 @@ Suite *u_users_suite(void) void rundebug() { + /* char *user_name = strdup("root"); struct passwd *ret_user = NULL; ret_user = getpwnam_ext(user_name); + */ } int main(void) diff --git a/src/resmom/test/catch_child/scaffolding.c b/src/resmom/test/catch_child/scaffolding.c index ca1d525a70..8069d15934 100644 --- a/src/resmom/test/catch_child/scaffolding.c +++ b/src/resmom/test/catch_child/scaffolding.c @@ -1327,3 +1327,9 @@ int insert_thing(resizable_array *ra, void *thing) { return(0); } + +int release_job_reservation(job *pjob) + { + return (0); + } + diff --git a/src/resmom/test/catch_child/test_post_epilogue.c b/src/resmom/test/catch_child/test_post_epilogue.c index 29e3d820a3..7e06e77985 100644 --- a/src/resmom/test/catch_child/test_post_epilogue.c +++ b/src/resmom/test/catch_child/test_post_epilogue.c @@ -19,7 +19,7 @@ START_TEST(test_pe_negsock) errno = EINTR; LOGLEVEL = 2; res = post_epilogue(pjob, ev); - /*fail_unless(res == 1, "This didn't return correctly");*/ + fail_unless(res == 1, "This didn't return correctly"); free(pjob); } END_TEST @@ -34,7 +34,7 @@ START_TEST(test_pe_negpostsock) tc = 2; errno = ETIMEDOUT; res = post_epilogue(pjob, ev); - /*fail_unless(res == 1, "This didn't return correctly");*/ + fail_unless(res == 1, "This didn't return correctly"); free(pjob); } END_TEST @@ -49,6 +49,7 @@ START_TEST(test_pe_prnull) tc = 3; errno = EINPROGRESS; res = post_epilogue(pjob, ev); + fail_unless(res == 1, "This didn't return correctly"); free(pjob); } END_TEST @@ -126,6 +127,7 @@ Suite *post_epilogue_suite(void) void rundebug() { + /* job *pjob = (job *)calloc(1, sizeof(job)); int ev = 0; int res = 0; @@ -135,6 +137,8 @@ void rundebug() errno = EINTR; LOGLEVEL = 7; res = post_epilogue(pjob, ev); + fail_unless(res == 1, "This didn't return correctly"); + */ } int main(void) diff --git a/src/resmom/test/start_exec/scaffolding.c b/src/resmom/test/start_exec/scaffolding.c index 296e57fbb5..8088c2ce6f 100644 --- a/src/resmom/test/start_exec/scaffolding.c +++ b/src/resmom/test/start_exec/scaffolding.c @@ -474,3 +474,8 @@ int create_alps_reservation( { return(0); } + +int destroy_alps_reservation(char *reservation_id, char *apbasil_path, char *apbasil_protocol) + { + return (0); + } diff --git a/src/resmom/test/start_exec/test_start_exec.c b/src/resmom/test/start_exec/test_start_exec.c index 96e79eb309..77ee440c83 100644 --- a/src/resmom/test/start_exec/test_start_exec.c +++ b/src/resmom/test/start_exec/test_start_exec.c @@ -9,7 +9,7 @@ #define MAX_TEST_ENVP 150 #define MAX_TEST_BLOCK 8096 -char **penv[MAX_TEST_ENVP]; /* max pointers a bld_env_variables will create */ +char *penv[MAX_TEST_ENVP]; /* max pointers a bld_env_variables will create */ char *envBuffer = NULL; /* points to the max block that bld_env_variables would ever need in this test suite */ void setup_vtable( @@ -28,7 +28,7 @@ void setup_vtable( vtable->v_block = vtable->v_block_start; for (i = 0; i < MAX_TEST_ENVP; ++i) - *(penv + i) = NULL; + penv[i] = NULL; envBuffer = calloc(MAX_TEST_BLOCK, sizeof(char)); } @@ -48,7 +48,7 @@ int add_env_variables( char varname[64]; char *varNval; - ptest_block = envBuffer; +ptest_block = envBuffer; for (i=0; i < n_env_vars; i++) { if (i != (n_env_vars - 1)) @@ -69,8 +69,8 @@ int add_env_variables( len = strlen(varname) + strlen(buf) + 1; varNval = (char *) calloc(len, sizeof(char)); sprintf(varNval, "%s%s", varname, buf); - *(penv + i) = ptest_block; - strcpy(*(penv + i), varNval); + penv[i] = ptest_block; + strcpy(penv[i], varNval); ptest_block += strlen(varNval) + 1; if (bld_env_variables(vtable, varNval, NULL) != PBSE_NONE) { diff --git a/src/server/Makefile.am b/src/server/Makefile.am index 5e566443cf..3bc67bfb35 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -51,5 +51,5 @@ install-exec-hook: $(DESTDIR)$(sbindir)/$(program_prefix)qserverd$(program_suffix)$(EXEEXT) uninstall-hook: - rm -f $(DESTDIR)$(PBS_ENVIRON) + rm -f $(DESTDIR)$(PBS_ENVIRON) $(DESTDIR)$(PBS_SERVER_HOME)/server_priv/nodes rm -f $(DESTDIR)$(sbindir)/$(program_prefix)qserverd$(program_suffix)$(EXEEXT) diff --git a/src/server/pbsd_main.c b/src/server/pbsd_main.c index 03032e4f10..04658b515d 100644 --- a/src/server/pbsd_main.c +++ b/src/server/pbsd_main.c @@ -120,7 +120,6 @@ #include "tracking.h" #include "acct.h" #include "sched_cmds.h" -#include "rpp.h" #include "dis.h" #include "dis_init.h" #include "batch_request.h" @@ -258,7 +257,6 @@ int queue_rank = 0; int a_opt_init = -1; int wait_for_moms_hierarchy = FALSE; -int route_retry_interval = 10; /* time in seconds to check routing queues */ /* HA global data items */ long HALockCheckTime = 0; long HALockUpdateTime = 0; @@ -417,7 +415,7 @@ int process_pbs_server_port( if (rc != DIS_SUCCESS) { - log_err(-1, __func__, "Cannot read version - skipping this request.\n"); + log_err(-1, __func__, (char *)"Cannot read version - skipping this request.\n"); rc = PBSE_SOCKET_CLOSE; break; } @@ -807,7 +805,7 @@ void parse_command_line( } else { - log_err(-1, __func__, "unable to determine full server hostname"); + log_err(-1, __func__, (char *)"unable to determine full server hostname"); } exit(1); @@ -1117,14 +1115,14 @@ static int start_hot_jobs(void) PBSEVENT_SYSTEM, PBS_EVENTCLASS_JOB, pjob->ji_qs.ji_jobid, - "attempting to hot start job"); + (char *)"attempting to hot start job"); svr_startjob(pjob, NULL, NULL, NULL); ct++; } - unlock_ji_mutex(pjob, __func__, "1", LOGLEVEL); + unlock_ji_mutex(pjob, __func__, (char *)"1", LOGLEVEL); } return(ct); @@ -1149,6 +1147,8 @@ void send_any_hellos_needed() } /* END send_any_hellos_needed() */ + + void *handle_queue_routing_retries( void *vp) @@ -1157,46 +1157,26 @@ void *handle_queue_routing_retries( pbs_queue *pque; char *queuename; int iter = -1; - void *status; - pthread_t queue_route_thread_id = -1; - pthread_attr_t queue_route_attr; - - - if ((pthread_attr_init(&queue_route_attr)) != 0) - { - perror("pthread_attr_init failed. handle_queue_routing_retries not started"); - log_err(-1, msg_daemonname, "pthread_attr_init failed. handle_queue_routing_retries not started"); - return(NULL); - } - else if (pthread_attr_setdetachstate(&queue_route_attr, PTHREAD_CREATE_JOINABLE) != 0) - { - perror("pthread_attr_setdetachstate failed. handle_queue_routing_retries not started"); - log_err(-1, msg_daemonname, "pthread_attr_setdetachstate failed. handle_queue_routing_retries not started"); - return(NULL); - } - - while(1) + while ((pque = next_queue(&svr_queues, &iter)) != NULL) { - sleep(route_retry_interval); - while ((pque = next_queue(&svr_queues, &iter)) != NULL) + if (pque->qu_qs.qu_type == QTYPE_RoutePush) { - if (pque->qu_qs.qu_type == QTYPE_RoutePush) - { - queuename = strdup(pque->qu_qs.qu_name); /* make sure this gets freed inside queue_route */ - unlock_queue(pque, __func__, NULL, 0); - pthread_create(&queue_route_thread_id, &queue_route_attr, queue_route, queuename); - pthread_join(queue_route_thread_id, &status); - } - else - unlock_queue(pque, __func__, NULL, 0); + queuename = strdup(pque->qu_qs.qu_name); /* make sure this gets freed inside queue_route */ + enqueue_threadpool_request(queue_route, queuename); } + + unlock_queue(pque, __func__, (char *)NULL, 0); } return(NULL); } /* END handle_queue_routing_retries() */ + + + + void *handle_scheduler_contact( void *vp) @@ -1231,21 +1211,21 @@ void start_accept_thread() { pthread_attr_t accept_attr; + accept_thread_id = -1; if ((pthread_attr_init(&accept_attr)) != 0) { perror("pthread_attr_init failed. Could not start accept thread"); - log_err(-1, msg_daemonname,"pthread_attr_init failed. Could not start accept thread"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_init failed. Could not start accept thread"); } else if ((pthread_attr_setdetachstate(&accept_attr, PTHREAD_CREATE_DETACHED) != 0)) { perror("pthread_attr_setdetatchedstate failed. Could not start accept thread"); - log_err(-1, msg_daemonname,"pthread_attr_setdetachedstate failed. Could not start accept thread"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_setdetachedstate failed. Could not start accept thread"); } else if ((pthread_create(&accept_thread_id, &accept_attr, start_accept_listener, NULL)) != 0) { - accept_thread_id = -1; perror("could not start listener for pbs_server"); - log_err(-1, msg_daemonname, "Failed to start listener for pbs_server"); + log_err(-1, msg_daemonname, (char *)"Failed to start listener for pbs_server"); } } /* END start_accept_thread() */ @@ -1258,17 +1238,17 @@ void start_routing_retry_thread() if ((pthread_attr_init(&routing_attr)) != 0) { perror("pthread_attr_init failed. Could not start accept thread"); - log_err(-1, msg_daemonname,"pthread_attr_init failed. Could not start handle_queue_routing_retries"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_init failed. Could not start handle_queue_routing_retries"); } else if ((pthread_attr_setdetachstate(&routing_attr, PTHREAD_CREATE_DETACHED) != 0)) { perror("pthread_attr_setdetatchedstate failed. Could not start accept thread"); - log_err(-1, msg_daemonname,"pthread_attr_setdetachedstate failed. Could not start handle_queue_routing_retries"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_setdetachedstate failed. Could not start handle_queue_routing_retries"); } else if ((pthread_create(&route_retry_thread_id, &routing_attr, handle_queue_routing_retries, NULL)) != 0) { perror("could not start listener for pbs_server"); - log_err(-1, msg_daemonname, "Failed to start handle_queue_routing_retries"); + log_err(-1, msg_daemonname, (char *)"Failed to start handle_queue_routing_retries"); } } /* END start_routing_retry_thread() */ @@ -1284,17 +1264,17 @@ void start_exiting_retry_thread() if (pthread_attr_init(&attr) != 0) { perror("pthread_attr_init failed. Could not start exiting retry thread"); - log_err(-1, msg_daemonname,"pthread_attr_init failed. Could not start inspect_exiting_jobs"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_init failed. Could not start inspect_exiting_jobs"); } else if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0) { perror("pthread_attr_setdetatchedstate failed. Could not start exiting retry thread"); - log_err(-1, msg_daemonname,"pthread_attr_setdetachedstate failed. Could not start inspect_exiting_jobs"); + log_err(-1, msg_daemonname,(char *)"pthread_attr_setdetachedstate failed. Could not start inspect_exiting_jobs"); } else if (pthread_create(&exiting_thread, &attr, inspect_exiting_jobs, NULL) != 0) { perror("could not start exiting job retry thread for pbs_server"); - log_err(-1, msg_daemonname, "Failed to start inspect_exiting_jobs"); + log_err(-1, msg_daemonname, (char *)"Failed to start inspect_exiting_jobs"); } } /* END start_exiting_retry_thread() */ @@ -1369,18 +1349,18 @@ void main_loop(void) /* for large systems, give newly reported nodes more time before being marked down while pbs_moms are initialy reporting in */ - set_task(WORK_Timed, when + svr_totnodes / 12, check_nodes, NULL, FALSE); + set_task(WORK_Timed, when + svr_totnodes / 12, check_nodes, (char *)NULL, FALSE); } else { - set_task(WORK_Timed, when, check_nodes, NULL, FALSE); + set_task(WORK_Timed, when, check_nodes, (char *)NULL, FALSE); } /* Just check the nodes with check_nodes above and don't ping anymore. */ - set_task(WORK_Timed, time_now + 5, check_log, NULL, FALSE); + set_task(WORK_Timed, time_now + 5, check_log, (char *)NULL, FALSE); - set_task(WORK_Timed,time_now + 10,check_acct_log, NULL, FALSE); + set_task(WORK_Timed,time_now + 10,check_acct_log, (char *)NULL, FALSE); /* * Now at last, we are ready to do some batch work. The @@ -1554,7 +1534,7 @@ void main_loop(void) if (pjob->ji_modified) job_save(pjob, SAVEJOB_FULL, 0); - unlock_ji_mutex(pjob, __func__, "1", LOGLEVEL); + unlock_ji_mutex(pjob, __func__, (char *)"1", LOGLEVEL); } if (svr_chngNodesfile) @@ -1895,7 +1875,7 @@ int main( if (write(lockfds, log_buf, strlen(log_buf)) != (ssize_t)strlen(log_buf)) { - log_err(errno, msg_daemonname, "failed to write pid to lockfile"); + log_err(errno, msg_daemonname, (char *)"failed to write pid to lockfile"); exit(-1); } @@ -1932,7 +1912,7 @@ int main( /* NOTE: env cleared in pbsd_init() */ if (pbsd_init(server_init_type) != PBSE_NONE) { - log_err(-1, msg_daemonname, "pbsd_init failed"); + log_err(-1, msg_daemonname, (char *)"pbsd_init failed"); exit(3); } @@ -1956,7 +1936,7 @@ int main( { perror("pbs_server: unix domain socket"); - log_err(-1, msg_daemonname, "init_network failed unix domain socket"); + log_err(-1, msg_daemonname, (char *)"init_network failed unix domain socket"); exit(3); } @@ -1968,7 +1948,7 @@ int main( if (poll_job_task_mutex == NULL) { perror("pbs_server: failed to initialize poll_job_task_mutex"); - log_err(-1, msg_daemonname, "pbs_server: failed to initialize poll_job_task_mutex"); + log_err(-1, msg_daemonname, (char *)"pbs_server: failed to initialize poll_job_task_mutex"); exit(3); } @@ -2046,7 +2026,7 @@ void check_job_log( if (log_remove_old(path_jobinfo_log, keep_days * SECS_PER_DAY) != 0) { - log_err(-1,"check_job_log","failure occurred when checking for old job logs"); + log_err(-1,"check_job_log",(char *)"failure occurred when checking for old job logs"); } } @@ -2061,7 +2041,7 @@ void check_job_log( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, - "Rolling job log file"); + (char *)"Rolling job log file"); if (roll_depth != -1) { @@ -2070,7 +2050,7 @@ void check_job_log( if ((depth >= INT_MAX) || (depth < 1)) { - log_err(-1, "check_job_log", "job log roll cancelled, logfile depth is out of range"); + log_err(-1, "check_job_log", (char *)"job log roll cancelled, logfile depth is out of range"); } else { @@ -2082,7 +2062,7 @@ void check_job_log( free(ptask->wt_mutex); free(ptask); - set_task(WORK_Timed, time_now + PBS_LOG_CHECK_RATE, check_job_log, NULL, FALSE); + set_task(WORK_Timed, time_now + PBS_LOG_CHECK_RATE, check_job_log, (char *)NULL, FALSE); } /* END check_job_log */ @@ -2114,7 +2094,7 @@ void check_log( if (log_remove_old(path_svrlog, keep_days * SECS_PER_DAY) != 0) { - log_err(-1,"check_log","failure occurred when checking for old pbs_server logs"); + log_err(-1,"check_log",(char *)"failure occurred when checking for old pbs_server logs"); } } @@ -2129,13 +2109,13 @@ void check_log( PBSEVENT_SYSTEM | PBSEVENT_FORCE, PBS_EVENTCLASS_SERVER, msg_daemonname, - "Rolling log file"); + (char *)"Rolling log file"); get_svr_attr_l(SRV_ATR_LogFileRollDepth, &roll_depth); if ((roll_depth >= INT_MAX) || (roll_depth < 1)) { - log_err(-1, "check_log", "log roll cancelled, logfile depth is out of range"); + log_err(-1, "check_log", (char *)"log roll cancelled, logfile depth is out of range"); } else { @@ -2158,7 +2138,7 @@ void check_log( free(ptask->wt_mutex); free(ptask); - set_task(WORK_Timed, time_now + PBS_LOG_CHECK_RATE, check_log, NULL, FALSE); + set_task(WORK_Timed, time_now + PBS_LOG_CHECK_RATE, check_log, (char *)NULL, FALSE); return; } /* END check_log */ @@ -2193,7 +2173,7 @@ void check_acct_log( free(ptask->wt_mutex); free(ptask); - set_task(WORK_Timed,time_now + PBS_ACCT_CHECK_RATE,check_acct_log,NULL,FALSE); + set_task(WORK_Timed,time_now + PBS_ACCT_CHECK_RATE,check_acct_log,(char *)NULL,FALSE); return; } /* END check_acct_log */ @@ -2358,7 +2338,7 @@ int is_ha_lock_file_valid( if (GoodPermissions == FALSE) { - log_err(-1, __func__, "could not obtain the needed permissions for the lock file"); + log_err(-1, __func__, (char *)"could not obtain the needed permissions for the lock file"); } return(GoodPermissions); @@ -2650,7 +2630,7 @@ int start_update_ha_lock_thread() if (fds < 0) { - log_err(-1, __func__, "Couldn't write the pid to the lockfile\n"); + log_err(-1, __func__, (char *)"Couldn't write the pid to the lockfile\n"); return(FAILURE); } @@ -2658,7 +2638,7 @@ int start_update_ha_lock_thread() snprintf(smallBuf,sizeof(smallBuf),"%ld\n",(long)sid); if (write(fds,smallBuf,strlen(smallBuf)) != (ssize_t)strlen(smallBuf)) { - log_err(-1, __func__, "Couldn't write the pid to the lockfile\n"); + log_err(-1, __func__, (char *)"Couldn't write the pid to the lockfile\n"); close(fds); return(FAILURE); @@ -2667,7 +2647,12 @@ int start_update_ha_lock_thread() /* we don't need an open handle on the lockfile, just correct update times */ close(fds); - pthread_attr_init(&HALockThreadAttr); + if ((rc = pthread_attr_init(&HALockThreadAttr)) != 0) + { + perror("pthread_attr_init failed. Could not start update ha lock thread"); + log_err(-1, msg_daemonname,"pthread_attr_init failed. Could not start ha lock thread"); + return FAILURE; + } rc = pthread_create(&HALockThread,&HALockThreadAttr,update_ha_lock_thread,NULL); @@ -2675,7 +2660,7 @@ int start_update_ha_lock_thread() { /* error creating thread */ - log_err(-1, __func__, "Could not create HA Lock Thread\n"); + log_err(-1, __func__, (char *)"Could not create HA Lock Thread\n"); return(FAILURE); } @@ -2699,7 +2684,7 @@ int mutex_lock( { if (pthread_mutex_lock(Mutex) != 0) { - log_err(-1,"mutex_lock","ALERT: cannot lock mutex!\n"); + log_err(-1,"mutex_lock",(char *)"ALERT: cannot lock mutex!\n"); return(FAILURE); } @@ -2717,7 +2702,7 @@ int mutex_unlock( { if (pthread_mutex_unlock(Mutex) != 0) { - log_err(-1,"mutex_unlock","ALERT: cannot unlock mutex!\n"); + log_err(-1,"mutex_unlock",(char *)"ALERT: cannot unlock mutex!\n"); return(FAILURE); } @@ -2773,7 +2758,7 @@ static void lock_out_ha() { /* try to get a filesystem lock on the "mutex" file */ - while (acquire_file_lock(MutexLockFile,&MutexLockFD,"HA") == FAILURE) + while (acquire_file_lock(MutexLockFile,&MutexLockFD, (char *)"HA") == FAILURE) { sprintf(log_buf,"Could not acquire HA flock--trying again in 1 second\n"); @@ -2853,7 +2838,7 @@ static void lock_out_ha() PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, __func__, - "high availability file lock obtained"); + (char *)"high availability file lock obtained"); } /* END lock_out_ha() */ @@ -2894,7 +2879,7 @@ static int daemonize_server( if ((pid = fork()) == -1) { - log_err(errno, __func__, "cannot fork into background"); + log_err(errno, __func__, (char *)"cannot fork into background"); return(FAILURE); } @@ -2908,7 +2893,7 @@ static int daemonize_server( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, __func__, - "INFO: parent is exiting"); + (char *)"INFO: parent is exiting"); exit(0); } @@ -2917,7 +2902,7 @@ static int daemonize_server( if ((*sid = setsid()) == -1) { - log_err(errno, __func__, "Could not disconnect from controlling terminal"); + log_err(errno, __func__, (char *)"Could not disconnect from controlling terminal"); return(FAILURE); } @@ -2939,7 +2924,7 @@ static int daemonize_server( if ((pid = fork()) == -1) { - log_err(errno, __func__, "cannot fork into background"); + log_err(errno, __func__, (char *)"cannot fork into background"); return(FAILURE); } @@ -2952,7 +2937,7 @@ static int daemonize_server( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, __func__, - "INFO: parent is exiting"); + (char *)"INFO: parent is exiting"); exit(0); } @@ -2965,7 +2950,7 @@ static int daemonize_server( PBSEVENT_SYSTEM, PBS_EVENTCLASS_SERVER, __func__, - "INFO: child process in background"); + (char *)"INFO: child process in background"); return(SUCCESS); } /* END daemonize_server() */ @@ -3085,7 +3070,7 @@ int get_full_path( { char *TokPtr = NULL; - char *Delims = ":;"; /* windows and unix path deliminators */ + char *Delims = (char *)":;"; /* windows and unix path deliminators */ char *PathLocation; char tmpPath[MAX_LINE]; bool_t IsExe = FALSE; @@ -3193,13 +3178,13 @@ int svr_restart() { free(ArgV[0]); - ArgV[0] = calloc(sizeof(char), (strlen(FullCmd) + 1)); + ArgV[0] = (char *)calloc(sizeof(char), (strlen(FullCmd) + 1)); if (ArgV[0] == NULL) { /* could not calloc */ - log_err(errno, __func__, "ERROR: cannot allocate memory for full command, cannot restart\n"); + log_err(errno, __func__, (char *)"ERROR: (char *) cannot allocate memory for full command, cannot restart\n"); exit(-10); } diff --git a/src/server/test/login_nodes/test_login_nodes.c b/src/server/test/login_nodes/test_login_nodes.c index 711b970b83..1f962146d2 100644 --- a/src/server/test/login_nodes/test_login_nodes.c +++ b/src/server/test/login_nodes/test_login_nodes.c @@ -108,6 +108,7 @@ START_TEST(retrieval_test) rc = add_to_login_holder(&n2); rc = add_to_login_holder(&n3); rc = add_to_login_holder(&n4); + fail_unless(rc == 0); rtd = get_next_login_node(NULL); increment_counts(&n1, &n2, &n3, &n4, rtd, &n1_rtd, &n2_rtd, &n3_rtd, &n4_rtd); @@ -197,6 +198,7 @@ START_TEST(prop_test) rc = add_to_login_holder(&n2); rc = add_to_login_holder(&n3); rc = add_to_login_holder(&n4); + fail_unless(rc == 0); rtd = get_next_login_node(props); increment_counts(&n1, &n2, &n3, &n4, rtd, &n1_rtd, &n2_rtd, &n3_rtd, &n4_rtd); diff --git a/src/test/test_scripts/blank_script.sh b/src/test/test_scripts/blank_script.sh old mode 100644 new mode 100755 diff --git a/src/test/test_scripts/confirm_reservation.sh b/src/test/test_scripts/confirm_reservation.sh old mode 100644 new mode 100755 diff --git a/src/test/test_scripts/execute_reservation.sh b/src/test/test_scripts/execute_reservation.sh old mode 100644 new mode 100755 diff --git a/src/test/test_scripts/get_inventory.sh b/src/test/test_scripts/get_inventory.sh old mode 100644 new mode 100755 diff --git a/src/test/test_scripts/release_reservation.sh b/src/test/test_scripts/release_reservation.sh old mode 100644 new mode 100755 diff --git a/src/tools/xpbsmon/Makefile.am b/src/tools/xpbsmon/Makefile.am index 19e22ec8b1..356a2b222a 100644 --- a/src/tools/xpbsmon/Makefile.am +++ b/src/tools/xpbsmon/Makefile.am @@ -49,5 +49,5 @@ install-data-hook: chmod 644 tclIndex uninstall-hook: - rm -f $(DESTDIR)$(XPBS_DIR)/buildindex + rm -f $(DESTDIR)$(XPBSMON_DIR)/buildindex