comparison py/utils.py @ 145:6517ddee3187

few more bits
author Matt Johnston <matt@ucc.asn.au>
date Thu, 29 Nov 2012 23:50:40 +0800
parents 482d7852b511
children d686b111dab4
comparison
equal deleted inserted replaced
144:482d7852b511 145:6517ddee3187
124 sys.exit(0) 124 sys.exit(0)
125 except OSError, e: 125 except OSError, e:
126 E("Bad fork()") 126 E("Bad fork()")
127 sys.exit(1) 127 sys.exit(1)
128 128
129 def uptime():
130 try:
131 return float(open('/proc/uptime', 'r').read().split(' ', 1)[0])
132 except Exception, e:
133 return -1
129 134