Changeset 170 for trunk/src/sh_processcheck.c
- Timestamp:
- Apr 30, 2008, 11:56:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_processcheck.c
r169 r170 394 394 } 395 395 396 /* These variables are not used anywhere. They only exist 397 * to assign &userold, &user to them, which keeps gcc from 398 * putting them into a register, and avoids the 'clobbered 399 * by longjmp' warning. And no, 'volatile' proved insufficient. 400 */ 401 static void * sh_dummy_watchlist = NULL; 402 396 403 static void check_watchlist (short * res) 397 404 { … … 399 406 char * tmp; 400 407 size_t indx; 408 409 /* Take the address to keep gcc from putting them into registers. 410 * Avoids the 'clobbered by longjmp' warning. 411 */ 412 sh_dummy_watchlist = (void*) &list; 401 413 402 414 while (list) … … 409 421 { 410 422 SH_MUTEX_LOCK(mutex_thread_nolog); 423 tmp = sh_util_safe_name (list->str); 411 424 sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 412 425 MSG_PCK_MISS, 413 list->str);426 tmp); 414 427 SH_MUTEX_UNLOCK(mutex_thread_nolog); 415 428 } … … 428 441 if (S_FALSE == is_in_list(&list_missing, list->str, 0)) 429 442 { 443 SH_MUTEX_LOCK(mutex_thread_nolog); 430 444 tmp = sh_util_safe_name (list->str); 431 SH_MUTEX_LOCK(mutex_thread_nolog);432 445 sh_error_handle(sh_prochk_severity, FIL__, __LINE__, 0, 433 446 MSG_PCK_MISS, … … 594 607 } 595 608 596 val = (val <= 0 ? 60 : val);597 598 609 sh_prochk_interval = (time_t) val; 599 610 SL_RETURN(0, _("sh_prochk_set_interval")); … … 625 636 static int proc_max_pid (size_t * procpid) 626 637 { 638 char * ret; 627 639 unsigned long pid; 628 640 FILE * fd; … … 640 652 { 641 653 str[0] = '\0'; 642 fgets(str, 128, fd);643 if ( *str != '\0')654 ret = fgets(str, 128, fd); 655 if (ret && *str != '\0') 644 656 { 645 657 pid = strtoul(str, &ptr, 0); … … 1055 1067 static int sh_process_check_int (short * res) 1056 1068 { 1057 size_t i, j; 1069 volatile size_t i; 1070 size_t j; 1058 1071 char tests[512]; 1059 int retval;1072 volatile int retval; 1060 1073 1061 1074 pid_t this_pid; … … 1207 1220 /* Initialise. 1208 1221 */ 1209 static int sh_prochk_init_internal( )1222 static int sh_prochk_init_internal(void) 1210 1223 { 1211 1224 SL_ENTER(_("sh_prochk_init")); … … 1267 1280 int sh_prochk_check(void) 1268 1281 { 1269 int status = 0;1282 int status; 1270 1283 1271 1284 SL_ENTER(_("sh_prochk_check")); 1272 1285 1273 1286 SH_MUTEX_LOCK(mutex_proc_check); 1287 1288 status = 0; 1289 1274 1290 if( ShProchkActive != S_FALSE ) 1275 1291 {
Note:
See TracChangeset
for help on using the changeset viewer.