diff --git a/src/kill.c b/src/kill.c index 322ba76..93fd2fb 100644 --- a/src/kill.c +++ b/src/kill.c @@ -2,6 +2,8 @@ #include #include +#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; } diff --git a/src/lib/error.c b/src/lib/error.c new file mode 100644 index 0000000..8822555 --- /dev/null +++ b/src/lib/error.c @@ -0,0 +1,8 @@ +#include +#include "error.h" + +int syserror(char *msg) +{ + fprintf(stderr,"%s",msg); + return 1; +} diff --git a/src/lib/error.h b/src/lib/error.h new file mode 100644 index 0000000..9cf87d7 --- /dev/null +++ b/src/lib/error.h @@ -0,0 +1 @@ +int syserror(char *msg);