mirror of https://git.qorg11.net/k9core.git
modified kill.c so doesn't use getopt (which in this case
was a complete overkill). Also a warning if nothing given.
This commit is contained in:
parent
0d9b8f2551
commit
61a4887fb1
|
@ -1,7 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <getopt.h>
|
|
||||||
|
|
||||||
void
|
void
|
||||||
list_signals(void)
|
list_signals(void)
|
||||||
|
@ -27,8 +26,12 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
int sig = 0;
|
int sig = 0;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int c = getopt(argc, argv,"l");
|
if(argc == 1)
|
||||||
if(c == 'l')
|
{
|
||||||
|
fprintf(stderr,"expected something\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(argv[1][1] == 'l')
|
||||||
{
|
{
|
||||||
list_signals();
|
list_signals();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue