Changeset 1528 for zzuf/trunk/src/zzuf.c
- Timestamp:
- Dec 29, 2006, 7:13:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/zzuf.c
r1526 r1528 30 30 #include <stdlib.h> 31 31 #include <unistd.h> 32 #include <regex.h> 32 33 #include <string.h> 33 34 #include <signal.h> … … 46 47 #endif 47 48 48 enum status49 {50 STATUS_FREE,51 STATUS_RUNNING,52 STATUS_SIGTERM,53 STATUS_SIGKILL,54 STATUS_EOF,55 };56 57 49 struct child_list 58 50 { 59 enum status status; 51 enum status 52 { 53 STATUS_FREE, 54 STATUS_RUNNING, 55 STATUS_SIGTERM, 56 STATUS_SIGKILL, 57 STATUS_EOF, 58 } status; 59 60 60 pid_t pid; 61 61 int outfd, errfd; 62 62 int bytes, seed; 63 63 time_t date; 64 } 65 *child_list; 64 } *child_list; 66 65 int parallel = 1, child_count = 0; 67 66 … … 82 81 int main(int argc, char *argv[]) 83 82 { 83 regex_t optre; 84 84 char **newargv; 85 85 char *parser; … … 121 121 { 122 122 case 'I': /* --include */ 123 if(regcomp(&optre, optarg, 0) != 0) 124 { 125 printf("%s: invalid regex -- `%s'\n", argv[0], optarg); 126 return EXIT_FAILURE; 127 } 128 regfree(&optre); 123 129 setenv("ZZUF_INCLUDE", optarg, 1); 124 130 break; 125 131 case 'E': /* --exclude */ 132 if(regcomp(&optre, optarg, 0) != 0) 133 { 134 printf("%s: invalid regex -- `%s'\n", argv[0], optarg); 135 return EXIT_FAILURE; 136 } 137 regfree(&optre); 126 138 setenv("ZZUF_EXCLUDE", optarg, 1); 127 139 break; … … 161 173 printf("%s: invalid option -- %c\n", argv[0], c); 162 174 printf(MOREINFO, argv[0]); 163 return 1;175 return EXIT_FAILURE; 164 176 } 165 177 } … … 329 341 } 330 342 } 343 344 /* Clean up */ 345 free(newargv); 346 free(child_list); 331 347 332 348 return EXIT_SUCCESS; … … 406 422 strcpy(tmp ? tmp + 1 : libpath, ".libs/libzzuf.so"); 407 423 if(access(libpath, R_OK) == 0) 408 {409 424 setenv("LD_PRELOAD", libpath, 1); 410 return;411 }425 else 426 setenv("LD_PRELOAD", LIBDIR "/libzzuf.so", 1); 412 427 free(libpath); 413 414 setenv("LD_PRELOAD", LIBDIR "/libzzuf.so", 1);415 428 } 416 429
Note: See TracChangeset
for help on using the changeset viewer.