- Timestamp:
- Mar 26, 2012, 2:38:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/common/oursrc/fuse-better-mousetrapfs/better-mousetrapfs
r2159 r2160 64 64 except KeyError: 65 65 group = '%d' % gid 66 cmdline = open('/proc/%d/cmdline' % pid).read().split('\0')[:-1] 67 exe = os.readlink('/proc/%d/exe' % pid) 68 status = dict(tuple(v.strip() for v in l.split(':', 1)) 69 for l in open('/proc/%d/status' % pid).readlines()) 70 cwd = os.readlink('/proc/%d/cwd' % pid) 66 67 # avoid races if process goes away (not 100% sure if this is 68 # possible; may be possible for multithreaded/async IO) 69 olddir = os.getcwd() 70 os.chdir("/proc/%d" % pid) 71 72 try: 73 cmdline = open('cmdline').read().split('\0')[:-1] 74 exe = os.readlink('exe') 75 status = dict(tuple(v.strip() for v in l.split(':', 1)) 76 for l in open('status').readlines()) 77 cwd = os.readlink('cwd') 78 finally: 79 os.chdir(olddir) 71 80 72 81 syslog.syslog(
Note: See TracChangeset
for help on using the changeset viewer.