From a5641bf514ded96c160e6cb94a1fdf9ede84778a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 9 Sep 2013 09:56:49 -0700 Subject: [PATCH] SpawnProcess: convert cgroup pids to int earlier --- pym/_emerge/SpawnProcess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py index 6024ef779..b36d15f69 100644 --- a/pym/_emerge/SpawnProcess.py +++ b/pym/_emerge/SpawnProcess.py @@ -190,7 +190,7 @@ class SpawnProcess(SubProcess): def get_pids(cgroup): try: with open(os.path.join(cgroup, 'cgroup.procs'), 'r') as f: - return f.read().split() + return [int(p) for p in f.read().split()] except OSError: # cgroup removed already? return [] @@ -198,7 +198,7 @@ class SpawnProcess(SubProcess): def kill_all(pids, sig): for p in pids: try: - os.kill(int(p), sig) + os.kill(p, sig) except OSError as e: if e.errno == errno.EPERM: # Reported with hardened kernel (bug #358211). -- 2.26.2