From: Zac Medico Date: Mon, 9 Sep 2013 16:56:49 +0000 (-0700) Subject: SpawnProcess: convert cgroup pids to int earlier X-Git-Tag: v2.2.2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5641bf514ded96c160e6cb94a1fdf9ede84778a;p=portage.git SpawnProcess: convert cgroup pids to int earlier --- 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).