Changeset 131 for trunk/src/samhain.c
- Timestamp:
- Oct 22, 2007, 11:19:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain.c
r96 r131 63 63 64 64 #include "samhain.h" 65 #include "sh_pthread.h" 65 66 #include "sh_files.h" 66 67 #include "sh_utils.h" … … 450 451 if (0 == strcmp (DEFAULT_MAILADDRESS, _("NULL"))) 451 452 { 453 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 454 char * saveptr; 455 (void) sl_strncpy(q, DEFAULT_MAILADDRESS, SH_PATHBUF); 456 p = strtok_r (q, ", \t", &saveptr); 457 if (p) 458 { 459 (void) sh_mail_setaddress_int (p); 460 while (NULL != (p = strtok_r (NULL, ", \t", &saveptr))) 461 (void) sh_mail_setaddress_int (p); 462 } 463 #else 452 464 (void) sl_strncpy(q, DEFAULT_MAILADDRESS, SH_PATHBUF); 453 465 p = strtok (q, ", \t"); … … 458 470 (void) sh_mail_setaddress_int (p); 459 471 } 472 #endif 460 473 } 461 474 #endif … … 747 760 return NULL; 748 761 } 762 763 SH_MUTEX_LOCK(readdir_lock); 764 749 765 while (NULL != (d = readdir(dp)) && i < 65535) 750 766 { … … 767 783 } 768 784 } 785 786 SH_MUTEX_UNLOCK(readdir_lock); 787 769 788 closedir(dp); 770 789 return pidlist; … … 1294 1313 if ( 0 == strcmp(argv[1], NOCL_CODE) ) 1295 1314 { 1315 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 1316 char * saveptr; 1317 #endif 1296 1318 my_argv[0] = argv[0]; ++my_argc; 1297 1319 command_line[0] = '\0'; … … 1299 1321 command_line[sizeof(command_line)-1] = '\0'; 1300 1322 do { 1323 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) 1301 1324 my_argv[my_argc] = 1302 strtok( (my_argc == 1) ? command_line : NULL, " \n"); 1325 strtok_r( (my_argc == 1) ? command_line : NULL, " \n", &saveptr); 1326 #else 1327 my_argv[my_argc] = 1328 strtok( (my_argc == 1) ? command_line : NULL, " \n"); 1329 #endif 1303 1330 if (my_argv[my_argc] != NULL) { 1304 1331 ++my_argc;
Note:
See TracChangeset
for help on using the changeset viewer.