From be34477bbd56710d3740bfb701546329404455b8 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 15 Mar 2012 21:05:08 +0100 Subject: [PATCH] skill: remove dead code Commit 991b8a94f0354a128085c7411713e17282c4e04a took use getopt_long(), which means the code that is related to earlier selfmade argument parsing is unnecessary. Signed-off-by: Sami Kerola --- skill.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/skill.c b/skill.c index 8fe06391..f91d44d6 100644 --- a/skill.c +++ b/skill.c @@ -473,9 +473,7 @@ static void skillsnice_parse(int argc, { int signo = -1; int prino = DEFAULT_NICE; - int num_found = 0; int ch, i; - const char *restrict argptr; static const struct option longopts[] = { {"command", required_argument, NULL, 'c'}, @@ -545,30 +543,10 @@ static void skillsnice_parse(int argc, { struct stat sbuf; char path[32]; - if (!optarg) - /* Huh? Maybe "skill -t ''". */ - skillsnice_usage(stderr); snprintf(path, 32, "/dev/%s", optarg); if (stat(path, &sbuf) >= 0 && S_ISCHR(sbuf.st_mode)) { - num_found++; ENLIST(tty, sbuf.st_rdev); - if (!NEXTARG) - break; - } else if (optarg && !(optarg[1])) { - /* if only 1 character */ - switch (*optarg) { - default: - if (stat(optarg, &sbuf) < 0) - /* the shell eats '?' */ - break; - case '-': - case '?': - num_found++; - ENLIST(tty, 0); - if (!NEXTARG) - break; - } } } break; @@ -577,10 +555,7 @@ static void skillsnice_parse(int argc, struct passwd *passwd_data; passwd_data = getpwnam(optarg); if (passwd_data) { - num_found++; ENLIST(uid, passwd_data->pw_uid); - if (!NEXTARG) - break; } } break;