Changeset 44555 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Feb 5, 2013 11:56:23 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
r44549 r44555 467 467 if (!rc) 468 468 { 469 # ifndef RT_OS_OS2 /* We don't need this on OS/2 and I don't recall if it's actually implemented. */ 470 rc = posix_spawnattr_setflags(&Attr, POSIX_SPAWN_SETPGROUP); 469 /* Indicate that process group and signal mask are to be changed, 470 and that the child should use default signal actions. */ 471 rc = posix_spawnattr_setflags(&Attr, POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSIGDEF); 471 472 Assert(rc == 0); 473 474 /* The child starts in its own process group. */ 472 475 if (!rc) 473 476 { … … 475 478 Assert(rc == 0); 476 479 } 477 # endif 478 sigset_t sigmask; 479 sigemptyset(&sigmask); 480 rc = posix_spawnattr_setsigmask(&Attr, &sigmask); 481 Assert(rc == 0); 480 481 /* Unmask all signals. */ 482 if (!rc) 483 { 484 sigset_t SigMask; 485 sigemptyset(&SigMask); 486 rc = posix_spawnattr_setsigmask(&Attr, &SigMask); Assert(rc == 0); 487 } 482 488 483 489 /* File changes. */ 484 490 posix_spawn_file_actions_t FileActions; 485 491 posix_spawn_file_actions_t *pFileActions = NULL; 486 if ( aStdFds[0] != -1 || aStdFds[1] != -1 || aStdFds[2] != -1)492 if ((aStdFds[0] != -1 || aStdFds[1] != -1 || aStdFds[2] != -1) && !rc) 487 493 { 488 494 rc = posix_spawn_file_actions_init(&FileActions); … … 534 540 * it's not worth doing anything as this process must exit. */ 535 541 if (fFlags & RTPROC_FLAGS_DETACHED) 536 _Exit(0);542 _Exit(0); 537 543 if (phProcess) 538 544 *phProcess = pid; … … 592 598 * Unset the signal mask. 593 599 */ 594 sigset_t sigmask; 595 sigemptyset(&sigmask); 596 sigprocmask(SIG_SETMASK, &sigmask, NULL); 600 sigset_t SigMask; 601 sigemptyset(&SigMask); 602 rc = sigprocmask(SIG_SETMASK, &SigMask, NULL); 603 Assert(rc == 0); 597 604 598 605 /*
Note:
See TracChangeset
for help on using the changeset viewer.