Changeset 131 for trunk/src/sh_schedule.c
- Timestamp:
- Oct 22, 2007, 11:19:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_schedule.c
r34 r131 130 130 struct tm * tval; 131 131 int count, i, nval; 132 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 133 struct tm time_tm; 134 #endif 132 135 133 136 if (!isched) … … 135 138 136 139 now = time(NULL); 140 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 141 tval = localtime_r(&now, &time_tm); 142 #else 137 143 tval = localtime(&now); 138 144 #endif 139 145 count = 0; 140 146 for (i = 0; i < 5; ++i) … … 320 326 int i = 0; 321 327 size_t len; 328 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 329 char * saveptr; 330 #endif 322 331 323 332 if (!ssched || !isched) … … 332 341 sl_strlcpy(copy, ssched, len); 333 342 343 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 344 p = strtok_r(copy, " \t", &saveptr); /* parse crontab-style schedule */ 345 #else 334 346 p = strtok(copy, " \t"); /* parse crontab-style schedule */ 347 #endif 348 335 349 if (!p) 336 350 goto err; … … 340 354 for (i = 1; i < 5; ++i) 341 355 { 356 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 357 p = strtok_r(NULL, " \t", &saveptr); /* parse crontab-style schedule */ 358 #else 342 359 p = strtok(NULL, " \t"); /* parse crontab-style schedule */ 360 #endif 343 361 if (!p) 344 362 goto err; … … 420 438 { 421 439 if (test_sched(&isched)) 422 printf("EXECUTE at: %s", ctime(&(isched.last_exec))); 440 printf("EXECUTE at: %s", ctime(&(isched.last_exec))); /* TESTONLY */ 423 441 sleep (1); /* TESTONLY */ 424 442 }
Note:
See TracChangeset
for help on using the changeset viewer.