]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
setarch: add "exec" message to --verbose
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 22 Mar 2016 11:14:45 +0000 (12:14 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 22 Mar 2016 13:13:33 +0000 (14:13 +0100)
Also we don't need fflush() in non-verbose case.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
sys-utils/setarch.c
tests/expected/misc/setarch

index b5e401c81cbcd71723b21e9f5dfd1fcd465cf3aa..cf29cf770a84a0dbebdf713a56f3ce61d78ff1b3 100644 (file)
@@ -391,8 +391,11 @@ int main(int argc, char *argv[])
        if (set_arch(arch, options, 0))
                err(EXIT_FAILURE, _("failed to set personality to %s"), arch);
 
-       /* flush all output streams before exec */
-       fflush(NULL);
+       if (verbose) {
+               printf(_("Execute command `%s'.\n"), argc ? argv[0] : "/bin/sh");
+               /* flush all output streams before exec */
+               fflush(NULL);
+       }
 
        if (!argc) {
                execl("/bin/sh", "-sh", NULL);
index 54208acf65dcf900f644d370885ee7a08854ab82..002493030767cf32b6c7999eafdfea685b435a43 100644 (file)
@@ -9,4 +9,5 @@ Switching on WHOLE_SECONDS.
 Switching on STICKY_TIMEOUTS.
 Switching on ADDR_LIMIT_3GB.
 Switching on UNAME26.
+Execute command `echo'.
 success