Changeset 459
- Timestamp:
- 01/22/08 09:53:56 (1 year ago)
- Files:
-
- trunk/SapphireImportHelper.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SapphireImportHelper.m
r452 r459 40 40 @end 41 41 42 static void childHandler(int i)43 {44 int status;45 pid_t child;46 47 while((child = waitpid(-1, &status, WNOHANG)) > 0);48 }49 50 42 @implementation SapphireImportHelper 51 43 … … 180 172 181 173 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:nil]; 182 /*Handle children crashing*/183 struct sigaction act;184 185 act.sa_handler = childHandler;186 act.sa_flags = SA_NOCLDWAIT;187 sigaction(SIGCHLD, &act, NULL);188 174 189 175 [self startClient]; … … 213 199 { 214 200 NSString *path = [[NSBundle bundleForClass:[SapphireImportHelper class]] pathForResource:@"ImportHelper" ofType:@""]; 215 const char *cpath = [path fileSystemRepresentation]; 216 int pid = fork(); 217 if(pid == 0) 218 { 219 const char *argv[2] = {cpath, NULL}; 220 execve(cpath, argv, NULL); 221 } 201 [NSTask launchedTaskWithLaunchPath:path arguments:[NSArray array]]; 222 202 } 223 203
