summaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak2014-05-26 12:48:35 +0200
committerKarel Zak2014-05-26 12:48:35 +0200
commita37811b51f45b60480aa4017fdec6c791a6d58c0 (patch)
tree5bac2bc2cc18b7e6b4ccc2feea681aaa88350b5c /sys-utils
parentMerge branch 'master' of https://github.com/rudimeier/util-linux (diff)
parentsetarch: add shortcut binary uname26 (diff)
downloadkernel-qcow2-util-linux-a37811b51f45b60480aa4017fdec6c791a6d58c0.tar.gz
kernel-qcow2-util-linux-a37811b51f45b60480aa4017fdec6c791a6d58c0.tar.xz
kernel-qcow2-util-linux-a37811b51f45b60480aa4017fdec6c791a6d58c0.zip
Merge branch 'setarch' of https://github.com/rudimeier/util-linux
* 'setarch' of https://github.com/rudimeier/util-linux: setarch: add shortcut binary uname26 setarch: flush output streams before exec
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/Makemodule.am2
-rw-r--r--sys-utils/setarch.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
index 2653385ef..a2a1d6df2 100644
--- a/sys-utils/Makemodule.am
+++ b/sys-utils/Makemodule.am
@@ -113,7 +113,7 @@ usrbin_exec_PROGRAMS += setarch
dist_man_MANS += sys-utils/setarch.8
setarch_SOURCES = sys-utils/setarch.c
-SETARCH_LINKS = linux32 linux64
+SETARCH_LINKS = uname26 linux32 linux64
if ARCH_S390
SETARCH_LINKS += s390 s390x
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index 957bb2b03..8e2b6e531 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -146,6 +146,7 @@ set_arch(const char *pers, unsigned long options, int list)
int perval;
const char *target_arch, *result_arch;
} transitions[] = {
+ {UNAME26, "uname26", NULL},
{PER_LINUX32, "linux32", NULL},
{PER_LINUX, "linux64", NULL},
#if defined(__powerpc__) || defined(__powerpc64__)
@@ -356,6 +357,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");