The following was inconflict with what usage() tells are valid option arguments. $ renice 1 -u 1000 renice: unknown user 1000 $ id uid=1000(kerolasa) ... Signed-off-by: Sami Kerola <kerolasa@xxxxxx> --- sys-utils/renice.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys-utils/renice.c b/sys-utils/renice.c index 1c4b840..1fef526 100644 --- a/sys-utils/renice.c +++ b/sys-utils/renice.c @@ -111,6 +111,7 @@ int main(int argc, char **argv) int which = PRIO_PROCESS; int who = 0, prio, errs = 0; char *endptr = NULL; + const char *error_msg; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); @@ -162,18 +163,20 @@ int main(int argc, char **argv) continue; } if (which == PRIO_USER) { - register struct passwd *pwd = getpwnam(*argv); + struct passwd *pwd = getpwnam(*argv); - if (pwd == NULL) { - warnx(_("unknown user %s"), *argv); - errs = 1; - continue; + if (pwd != NULL) + who = pwd->pw_uid; + else { + error_msg = _("unknown user %s"); + goto numeric_pid; } - who = pwd->pw_uid; } else { + error_msg = _("bad value %s"); + numeric_pid: who = strtol(*argv, &endptr, 10); if (who < 0 || *endptr) { - warnx(_("bad value %s"), *argv); + warnx(error_msg, *argv); errs = 1; continue; } -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html