int main(int argc, char **argv)
{
- int signo, i, sigopt=0, loop=1;
+ int signo, i, loop=1;
long pid;
int exitvalue = EXIT_SUCCESS;
signo = skill_sig_option(&argc, argv);
if (signo < 0)
signo = SIGTERM;
- else
- sigopt++;
opterr=0; /* suppress errors on -123 */
while (loop == 1 && (i = getopt_long(argc, argv, "l::Ls:hV", longopts, NULL)) != -1)
print_usage(stderr);
}
- argc -= optind + sigopt;
+ argc -= optind;
argv += optind;
for (i = 0; i < argc; i++) {
int skill_sig_option(int *argc, char **argv)
{
- int i, nargs = *argc;
+ int i;
int signo = -1;
- for (i = 1; i < nargs; i++) {
+ for (i = 1; i < *argc; i++) {
if (argv[i][0] == '-') {
signo = signal_name_to_number(argv[i] + 1);
if (-1 < signo) {
- if (nargs - i) {
- nargs--;
- memmove(argv + i, argv + i + 1,
- sizeof(char *) * (nargs - i));
- }
+ memmove(argv + i, argv + i + 1,
+ sizeof(char *) * (*argc - i));
+ (*argc)--;
return signo;
}
}
prino = snice_prio_option(&argc, argv);
else if (program == PROG_SKILL) {
signo = skill_sig_option(&argc, argv);
- if (-1 < signo) {
+ if (-1 < signo)
sig_or_pri = signo;
- argc -= 1;
- }
}
pid_count = 0;