/[path-sandbox]/trunk/sandbox.c
Gentoo

Diff of /trunk/sandbox.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 85 Revision 86
351 return 1; 351 return 1;
352} 352}
353 353
354int spawn_shell(char *argv_bash[]) 354int spawn_shell(char *argv_bash[])
355{ 355{
356#ifndef NO_FORK
357 int pid; 356 int pid;
358 int status = 0; 357 int status = 0;
359 int ret = 0; 358 int ret = 0;
360 359
361 pid = fork(); 360 pid = fork();
362 361
363 /* Child's process */ 362 /* Child's process */
364 if (0 == pid) { 363 if (0 == pid) {
365#endif
366 execv(argv_bash[0], argv_bash); 364 execv(argv_bash[0], argv_bash);
367#ifndef NO_FORK
368 return 0; 365 return 0;
369 } else if (pid < 0) { 366 } else if (pid < 0) {
370 return 0; 367 return 0;
371 } 368 }
372 ret = waitpid(pid, &status, 0); 369 ret = waitpid(pid, &status, 0);
373 if ((-1 == ret) || (status > 0)) 370 if ((-1 == ret) || (status > 0))
374 return 0; 371 return 0;
375#endif 372
376 return 1; 373 return 1;
377} 374}
378 375
379int main(int argc, char **argv) 376int main(int argc, char **argv)
380{ 377{

Legend:
Removed from v.85  
changed lines
  Added in v.86

  ViewVC Help
Powered by ViewVC 1.1.20