]> err.no Git - util-linux/commitdiff
ionice: non-cryptic error message when ionice can't execvp
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 3 May 2010 18:24:26 +0000 (18:24 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 6 May 2010 07:18:20 +0000 (09:18 +0200)
Previously ionice would reply like this when it couldn't find the
command to execute:

    $ ionice -c 3 does-not-exist
    ionice: execvp failed: No such file or directory

Getting that message from cron because you haven't set the right $PATH
makes it hard to track down the problem. Now it says:

    $ ionice -c 3 does-not-exist
    ionice: executing does-not-exist failed: No such file or directory

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
schedutils/ionice.c

index a57cf7f26729860d5b6bebe4f702c22f7474c45b..3ad4ef9a6d707bea8fe35ff36e191855d2b142a3 100644 (file)
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
                        ioprio_setpid(0, ioprio, ioclass);
                        execvp(argv[optind], &argv[optind]);
                        /* execvp should never return */
-                       err(EXIT_FAILURE, _("execvp failed"));
+                       err(EXIT_FAILURE, _("executing %s failed"), argv[optind]);
                }
        }