start openbsd ports

This commit is contained in:
bilaliscarioth
2025-07-08 02:13:33 +02:00
parent cae5f9a56f
commit 0cb605b529
5 changed files with 44 additions and 7 deletions

View File

@ -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