library: uptime API changes
Removed the printf_uptime, binaries can do printf easily enough. sprint_uptime split into two as there wasn't a lot of common code sprint_uptime(): old style uptime line sprint_uptime_short(): short new style "uptime -p" Hertz_hack needed this, no sane system uses the code (I think) so just assume 100 like we do in FreeBSD.
This commit is contained in:
7
uptime.c
7
uptime.c
@@ -28,7 +28,7 @@
|
||||
#include "fileutils.h"
|
||||
#include "nls.h"
|
||||
#include "proc/sysinfo.h"
|
||||
#include "proc/whattime.h"
|
||||
#include <proc/uptime.h>
|
||||
#include "proc/version.h"
|
||||
|
||||
static void print_uptime_since()
|
||||
@@ -104,6 +104,9 @@ int main(int argc, char **argv)
|
||||
usage(stderr);
|
||||
}
|
||||
|
||||
print_uptime(p);
|
||||
if (p)
|
||||
printf("%s\n", sprint_uptime());
|
||||
else
|
||||
printf("%s\n", sprint_uptime_short());
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user