aboutsummaryrefslogtreecommitdiffstats
path: root/guts
diff options
context:
space:
mode:
Diffstat (limited to 'guts')
-rw-r--r--guts/clone.c20
-rw-r--r--guts/fork.c27
2 files changed, 18 insertions, 29 deletions
diff --git a/guts/clone.c b/guts/clone.c
index 8299c54..b3400c7 100644
--- a/guts/clone.c
+++ b/guts/clone.c
@@ -12,21 +12,15 @@
* undo it later. UGH!
*/
pseudo_debug(1, "client resetting for clone(2) call\n");
- if (real_clone) {
- if (!pseudo_get_value("PSEUDO_RELOADED")) {
- pseudo_setupenv();
- pseudo_reinit_libpseudo();
- } else {
- pseudo_setupenv();
- pseudo_dropenv();
- }
- /* call the real syscall */
- rc = (*real_clone)(fn, child_stack, flags, arg, pid, tls, ctid);
+ if (!pseudo_get_value("PSEUDO_RELOADED")) {
+ pseudo_setupenv();
+ pseudo_reinit_libpseudo();
} else {
- /* rc was initialized to the "failure" value */
- pseudo_enosys("clone");
+ pseudo_setupenv();
+ pseudo_dropenv();
}
-
+ /* call the real syscall */
+ rc = (*real_clone)(fn, child_stack, flags, arg, pid, tls, ctid);
/* ...
* return rc;
* }
diff --git a/guts/fork.c b/guts/fork.c
index b7fd239..76cac6f 100644
--- a/guts/fork.c
+++ b/guts/fork.c
@@ -6,23 +6,18 @@
* wrap_fork(void) {
* int rc = -1;
*/
- if (real_fork) {
- rc = real_fork();
- /* special case: we may want to enable or disable
- * pseudo in the child process
- */
- if (rc == 0) {
- if (!pseudo_get_value("PSEUDO_RELOADED")) {
- pseudo_setupenv();
- pseudo_reinit_libpseudo();
- } else {
- pseudo_setupenv();
- pseudo_dropenv();
- }
+ rc = real_fork();
+ /* special case: we may want to enable or disable
+ * pseudo in the child process
+ */
+ if (rc == 0) {
+ if (!pseudo_get_value("PSEUDO_RELOADED")) {
+ pseudo_setupenv();
+ pseudo_reinit_libpseudo();
+ } else {
+ pseudo_setupenv();
+ pseudo_dropenv();
}
- } else {
- /* rc was initialized to the "failure" value */
- pseudo_enosys("fork");
}
/* return rc;
* }