Lines 1-11
Link Here
|
1 |
--- xonsh/xoreutils/uptime.py.orig 2017-02-11 16:24:07 UTC |
1 |
--- xonsh/xoreutils/uptime.py.orig 2018-09-13 12:52:13.885001000 +0200 |
2 |
+++ xonsh/xoreutils/uptime.py |
2 |
+++ xonsh/xoreutils/uptime.py 2018-09-13 12:53:15.599470000 +0200 |
3 |
@@ -100,7 +100,7 @@ def _uptime_bsd(): |
3 |
@@ -100,13 +100,13 @@ |
4 |
return None |
4 |
return None |
5 |
# Determine how much space we need for the response. |
5 |
# Determine how much space we need for the response. |
6 |
sz = ctypes.c_uint(0) |
6 |
sz = ctypes.c_uint(0) |
7 |
- xp.LIBC.sysctlbyname('kern.boottime', None, ctypes.byref(sz), None, 0) |
7 |
- xp.LIBC.sysctlbyname("kern.boottime", None, ctypes.byref(sz), None, 0) |
8 |
+ xp.LIBC.sysctlbyname(b'kern.boottime', None, ctypes.byref(sz), None, 0) |
8 |
+ xp.LIBC.sysctlbyname(b"kern.boottime", None, ctypes.byref(sz), None, 0) |
9 |
if sz.value != struct.calcsize('@LL'): |
9 |
if sz.value != struct.calcsize("@LL"): |
10 |
# Unexpected, let's give up. |
10 |
# Unexpected, let's give up. |
11 |
return None |
11 |
return None |
|
|
12 |
# For real now. |
13 |
buf = ctypes.create_string_buffer(sz.value) |
14 |
- xp.LIBC.sysctlbyname("kern.boottime", buf, ctypes.byref(sz), None, 0) |
15 |
+ xp.LIBC.sysctlbyname(b"kern.boottime", buf, ctypes.byref(sz), None, 0) |
16 |
sec, usec = struct.unpack_from("@LL", buf.raw) |
17 |
# OS X disagrees what that second value is. |
18 |
if usec > 1000000: |