From: Ruediger Meier Date: Tue, 22 Mar 2016 11:14:45 +0000 (+0100) Subject: setarch: add "exec" message to --verbose X-Git-Tag: v2.28-rc2~5^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9508e2972b1fdfca81e95ad7c2310991695009b5;p=thirdparty%2Futil-linux.git setarch: add "exec" message to --verbose Also we don't need fflush() in non-verbose case. Signed-off-by: Ruediger Meier --- diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index b5e401c81c..cf29cf770a 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -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); diff --git a/tests/expected/misc/setarch b/tests/expected/misc/setarch index 54208acf65..0024930307 100644 --- a/tests/expected/misc/setarch +++ b/tests/expected/misc/setarch @@ -9,4 +9,5 @@ Switching on WHOLE_SECONDS. Switching on STICKY_TIMEOUTS. Switching on ADDR_LIMIT_3GB. Switching on UNAME26. +Execute command `echo'. success