summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/setarch.c3
-rw-r--r--tests/expected/misc/setarch11
2 files changed, 14 insertions, 0 deletions
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index 957bb2b03..f957c7975 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -356,6 +356,9 @@ int main(int argc, char *argv[])
if (set_arch(p, options, 0))
err(EXIT_FAILURE, _("Failed to set personality to %s"), p);
+ /* flush all output streams before exec */
+ fflush(NULL);
+
if (!argc) {
execl("/bin/sh", "-sh", NULL);
err(EXIT_FAILURE, _("failed to execute %s"), "/bin/sh");
diff --git a/tests/expected/misc/setarch b/tests/expected/misc/setarch
index 2e9ba477f..54208acf6 100644
--- a/tests/expected/misc/setarch
+++ b/tests/expected/misc/setarch
@@ -1 +1,12 @@
+Switching on ADDR_NO_RANDOMIZE.
+Switching on FDPIC_FUNCPTRS.
+Switching on MMAP_PAGE_ZERO.
+Switching on ADDR_COMPAT_LAYOUT.
+Switching on READ_IMPLIES_EXEC.
+Switching on ADDR_LIMIT_32BIT.
+Switching on SHORT_INODE.
+Switching on WHOLE_SECONDS.
+Switching on STICKY_TIMEOUTS.
+Switching on ADDR_LIMIT_3GB.
+Switching on UNAME26.
success