diff options
author | Ron Yorston <rmy@pobox.com> | 2018-11-27 10:14:01 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-11-27 10:49:24 +0000 |
commit | 3ea280b8326e1d9d8c7b9b1fbcb19af2c674e309 (patch) | |
tree | fb2ac6a424f154a915261f92ab100abb2b9820bd | |
parent | 0ecf1e541e1cf550724b0a5dd3a5c74cf807f36b (diff) | |
download | busybox-w32-3ea280b8326e1d9d8c7b9b1fbcb19af2c674e309.tar.gz busybox-w32-3ea280b8326e1d9d8c7b9b1fbcb19af2c674e309.tar.bz2 busybox-w32-3ea280b8326e1d9d8c7b9b1fbcb19af2c674e309.zip |
ps: bring code marginally more into line with upstream
-rw-r--r-- | procps/ps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/procps/ps.c b/procps/ps.c index de062fe8b..4e6dc1ef9 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -125,7 +125,9 @@ static unsigned long get_uptime(void) | |||
125 | if (sysinfo(&info) < 0) | 125 | if (sysinfo(&info) < 0) |
126 | return 0; | 126 | return 0; |
127 | return info.uptime; | 127 | return info.uptime; |
128 | #elif !ENABLE_PLATFORM_MINGW32 | 128 | #elif ENABLE_PLATFORM_MINGW32 |
129 | return GetTickCount64()/1000; | ||
130 | #elif 1 | ||
129 | unsigned long uptime; | 131 | unsigned long uptime; |
130 | char buf[sizeof(uptime)*3 + 2]; | 132 | char buf[sizeof(uptime)*3 + 2]; |
131 | /* /proc/uptime is "UPTIME_SEC.NN IDLE_SEC.NN\n" | 133 | /* /proc/uptime is "UPTIME_SEC.NN IDLE_SEC.NN\n" |
@@ -136,8 +138,6 @@ static unsigned long get_uptime(void) | |||
136 | buf[sizeof(buf)-1] = '\0'; | 138 | buf[sizeof(buf)-1] = '\0'; |
137 | sscanf(buf, "%lu", &uptime); | 139 | sscanf(buf, "%lu", &uptime); |
138 | return uptime; | 140 | return uptime; |
139 | #elif ENABLE_PLATFORM_MINGW32 | ||
140 | return GetTickCount64()/1000; | ||
141 | #else | 141 | #else |
142 | struct timespec ts; | 142 | struct timespec ts; |
143 | if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) | 143 | if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) |