From e1eee2721587a7255b29ec8ba1c753c88f7ccb16 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Mon, 5 Feb 2007 20:59:03 +0000 Subject: [PATCH] Fix the last, horribly broken commit. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2491 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- src/Makefile-files | 2 +- src/vkill.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Makefile-files b/src/Makefile-files index 704a86a..370d569 100644 --- a/src/Makefile-files +++ b/src/Makefile-files @@ -210,7 +210,7 @@ src_reducecap_LDFLAGS = $(VSERVER_LDFLGS) src_vkill_SOURCES = src/vkill.c src_vkill_LDADD = $(VSERVER_LDADDS) -src_vkill_LDFLAGS = $(VSERVER_LDFLGS) +src_vkill_LDFLAGS = $(VSERVER_LDFLGS) $(LIBINTERNAL) src_vkill_CPPFLAGS = $(AM_CPPFLAGS) -DLEGACYDIR=\"$(legacydir)\" src_vlimit_SOURCES = src/vlimit.c diff --git a/src/vkill.c b/src/vkill.c index 02a8dc4..d934197 100644 --- a/src/vkill.c +++ b/src/vkill.c @@ -152,11 +152,21 @@ kill_wrapper(xid_t xid, char const *pid, int sig) } #else // VC_ENABLE_API_LEGACY inline static int -kill_wrapper(xid_t xid, char const *pid, int sig) +kill_wrapper(xid_t xid, char const *pid_s, int sig) { + pid_t pid; + long tmp; + + if (!isNumber(pid_s, &tmp, true)) { + WRITE_MSG(2, "vkill: '"); + WRITE_STR(2, pid_s); + WRITE_MSG(2, "' is not a number\n"); + } + pid = (pid_t) tmp; + if (xid==VC_NOCTX) xid = vc_get_task_xid(pid); - if (vc_ctx_kill(xid,atoi(pid),sig)==-1) { + if (vc_ctx_kill(xid,pid,sig)==-1) { perror("vkill: vc_ctx_kill()"); return 1; } -- 1.8.1.5