Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-04-06 22:20:28 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-04-06 22:20:28 +0300
commita26711a2d1464167be4ebc990fe21a3809a2da34 (patch)
treec48559fea73287479418e5f10d38157f5377cae4 /libbb
parent05f2bedaebd694605abd1f199fc25d93ad73840b (diff)
libbb: consolidate NOMMU fix of restoring high bit in argv[0][0]
function old new delta fork_or_rexec 46 56 +10 bootchartd_main 1087 1079 -8 cpio_main 674 661 -13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 10/-21) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/vfork_daemon_rexec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 79141936a..a570ddbf2 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -268,10 +268,12 @@ pid_t FAST_FUNC fork_or_rexec(char **argv)
/* fflush_all(); ? - so far all callers had no buffered output to flush */
pid = xvfork();
- if (pid) /* parent */
- return pid;
- /* child - re-exec ourself */
- re_exec(argv);
+ if (pid == 0) /* child - re-exec ourself */
+ re_exec(argv); /* NORETURN */
+
+ /* parent */
+ argv[0][0] &= 0x7f; /* undo re_rexec() damage */
+ return pid;
}
#endif