0022-skill: Simplify the kill_main() loop.
Right now the "loop=0; break;" is never reached.
This commit is contained in:
parent
f69d54f05b
commit
c704460c7d
7
kill.c
7
kill.c
@ -50,7 +50,7 @@ static void __attribute__ ((__noreturn__)) print_usage(FILE * out)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int signo, i, loop=1;
|
int signo, i;
|
||||||
long pid;
|
long pid;
|
||||||
int exitvalue = EXIT_SUCCESS;
|
int exitvalue = EXIT_SUCCESS;
|
||||||
int optindex;
|
int optindex;
|
||||||
@ -79,7 +79,7 @@ int main(int argc, char **argv)
|
|||||||
signo = SIGTERM;
|
signo = SIGTERM;
|
||||||
|
|
||||||
opterr=0; /* suppress errors on -123 */
|
opterr=0; /* suppress errors on -123 */
|
||||||
while (loop == 1 && (i = getopt_long(argc, argv, "l::Ls:hV", longopts, &optindex)) != -1)
|
while ((i = getopt_long(argc, argv, "l::Ls:hV", longopts, &optindex)) != -1)
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 'l':
|
case 'l':
|
||||||
sig_option = NULL;
|
sig_option = NULL;
|
||||||
@ -124,8 +124,7 @@ int main(int argc, char **argv)
|
|||||||
exitvalue = EXIT_FAILURE;
|
exitvalue = EXIT_FAILURE;
|
||||||
exit(exitvalue);
|
exit(exitvalue);
|
||||||
}
|
}
|
||||||
loop=0;
|
xerrx(EXIT_FAILURE, _("internal error"));
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
print_usage(stderr);
|
print_usage(stderr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user