Created error.h and error.c for syserror()
This commit is contained in:
parent
aff3c77b37
commit
0ff31634d9
|
@ -2,6 +2,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "lib/error.h"
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -21,6 +23,10 @@ main(int argc, char *argv[])
|
|||
fprintf(stderr, "Specify who to kill\n");
|
||||
return 1;
|
||||
}
|
||||
kill(pid,sig);
|
||||
int fd = kill(pid,sig);
|
||||
|
||||
if(fd == -1)
|
||||
syserror("Could not kill process\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
#include "error.h"
|
||||
|
||||
int syserror(char *msg)
|
||||
{
|
||||
fprintf(stderr,"%s",msg);
|
||||
return 1;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
int syserror(char *msg);
|
Loading…
Reference in New Issue