openbsd-ports/sysutils/d-feet/patches/patch-dfeet__util_py
2011-11-14 19:16:51 +00:00

25 lines
718 B
Plaintext

$OpenBSD: patch-dfeet__util_py,v 1.2 2011/11/14 19:16:51 ajacoutot Exp $
--- dfeet/_util.py.orig Tue Mar 15 22:45:55 2011
+++ dfeet/_util.py Mon Nov 14 20:13:57 2011
@@ -1,18 +1,9 @@
import os
+import subprocess
# TODO: Check against other Unix's
def get_proc_from_pid(pid):
- procpath = '/proc/' + str(pid) + '/cmdline'
- fullpath = ''
-
- try:
- f = open(procpath, 'r')
- fullpath = f.readline().split('\0')
- f.close()
- except:
- pass
-
- return fullpath
+ return subprocess.Popen(['/bin/ps','-c', '-o', 'command=', '-p', str(pid)], stdout=subprocess.PIPE ).communicate()[0].strip().split('\0')
# TODO: figure out more robust way to do this
def get_ui_dir():