do not do the lo-check anymore
[util-vserver.git] / util-vserver / src / vkill.c
index 918e596..dad9cb7 100644 (file)
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
 #endif
-#include "compat.h"
 
 #include "vserver.h"
 #include "linuxvirtual.h"
+#include "util.h"
 
 #include <getopt.h>
 #include <signal.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
 
-#define VERSION_COPYRIGHT_DISCLAIMER
-
 #define CMD_HELP       0x8000
 #define CMD_VERSION    0x8001
 
-#define WRITE_MSG(FD,X)         (void)(write(FD,X,sizeof(X)-1))
-#define WRITE_STR(FD,X)         writeStr(FD,X)
-
 static struct option const
 CMDLINE_OPTIONS[] = {
   { "help",     no_argument,  0, CMD_HELP },
@@ -65,12 +60,6 @@ static char const * const SIGNALS[] = {
   0,
 };
 
-inline static void UNUSED
-writeStr(int fd, char const *cmd)
-{
-  (void)write(fd, cmd, strlen(cmd));
-}
-
 static void
 showHelp(int fd, char const *cmd, int res)
 {
@@ -119,7 +108,7 @@ kill_wrapper_legacy(xid_t UNUSED ctx, char const *proc, int UNUSED sig)
 {
   pid_t                pid = fork();
   if (pid==-1) {
-    perror("fork()");
+    perror("vkill: fork()");
     exit(1);
   }
   else if (pid==0) {
@@ -132,7 +121,7 @@ kill_wrapper_legacy(xid_t UNUSED ctx, char const *proc, int UNUSED sig)
   }
 
   execl(LEGACYDIR "/vkill", "legacy/vkill", proc, (void *)(0));
-  perror("execl()");
+  perror("vkill: execl()");
   exit(1);
 }
 
@@ -146,7 +135,7 @@ kill_wrapper(xid_t ctx, char const *pid, int sig)
       return kill_wrapper_legacy(ctx, pid, sig);
     else {
       errno = err;
-      perror("vc_ctx_kill()");
+      perror("vkill: vc_ctx_kill()");
       return 1;
     }
   }
@@ -158,7 +147,7 @@ inline static int
 kill_wrapper(xid_t ctx, char const *pid, int sig)
 {
   if (vc_ctx_kill(ctx,atoi(pid),sig)==-1) {
-    perror("vc_ctx_kill()");
+    perror("vkill: vc_ctx_kill()");
     return 1;
   }
   return 0;