Try to figure out the xid if not specified.
[util-vserver.git] / src / vkill.c
index 489046f..02a8dc4 100644 (file)
@@ -154,6 +154,8 @@ kill_wrapper(xid_t xid, char const *pid, int sig)
 inline static int
 kill_wrapper(xid_t xid, char const *pid, int sig)
 {
+  if (xid==VC_NOCTX)
+    xid = vc_get_task_xid(pid);
   if (vc_ctx_kill(xid,atoi(pid),sig)==-1) {
     perror("vkill: vc_ctx_kill()");
     return 1;