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

Diff of /trunk/src/sandbox.c

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

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

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

  ViewVC Help
Powered by ViewVC 1.1.20