Changeset 2161


Ignore:
Timestamp:
Mar 26, 2012, 2:40:15 PM (13 years ago)
Author:
ezyang
Message:
Remove pointless race checking; kernel doesn't preserve old proc directories.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/fuse-better-mousetrapfs/better-mousetrapfs

    r2160 r2161  
    6464        except KeyError:
    6565            group = '%d' % gid
    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)
     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)
    8071
    8172        syslog.syslog(
Note: See TracChangeset for help on using the changeset viewer.