Skip to content

Instantly share code, notes, and snippets.

@avar
Created May 3, 2010 18:27
Show Gist options
  • Select an option

  • Save avar/388414 to your computer and use it in GitHub Desktop.

Select an option

Save avar/388414 to your computer and use it in GitHub Desktop.
From d580c4a75e4009110a1ec7eee161a18746db441e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avarab@gmail.com>
Date: Mon, 3 May 2010 18:21:36 +0000
Subject: [PATCH] ionice: non-cryptic error message when ionice can't execvp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/schedutils/ionice.c b/schedutils/ionice.c
index a57cf7f..3ad4ef9 100644
--- a/schedutils/ionice.c
+++ b/schedutils/ionice.c
@@ -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]);
}
}
--
1.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment