start openbsd ports
This commit is contained in:
@ -62,7 +62,13 @@ long User::uptime_as_seconds() {
|
||||
|
||||
#if HAVE_CPU_BSD
|
||||
struct timespec s_info;
|
||||
if (0 == clock_gettime(CLOCK_UPTIME_PRECISE, &s_info)) {
|
||||
int flags = 0;
|
||||
#ifndef __OpenBSD__
|
||||
flags = CLOCK_UPTIME_PRECISE;
|
||||
#else
|
||||
flags = CLOCK_UPTIME;
|
||||
#endif
|
||||
if (0 == clock_gettime(flags, &s_info)) {
|
||||
uptime = s_info.tv_sec;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user