diff --git a/contrib/wpa/src/utils/os_unix.c b/contrib/wpa/src/utils/os_unix.c --- a/contrib/wpa/src/utils/os_unix.c +++ b/contrib/wpa/src/utils/os_unix.c @@ -72,7 +72,6 @@ return res; } - int os_get_reltime(struct os_reltime *t) { #ifndef __MACH__ @@ -97,15 +96,21 @@ return 0; } switch (clock_id) { -#ifdef CLOCK_BOOTTIME +#if defined(CLOCK_BOOTTIME) case CLOCK_BOOTTIME: clock_id = CLOCK_MONOTONIC; break; #endif -#ifdef CLOCK_MONOTONIC +#if defined(CLOCK_MONOTONIC) +/* + * FreeBSD has both BOOTTIME and MONOTONIC defined to the same value, since they + * mean the same thing. FreeBSD 14.1 and ealier don't, so need this case. + */ +#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME == CLOCK_MONOTONIC) case CLOCK_MONOTONIC: clock_id = CLOCK_REALTIME; break; +#endif #endif case CLOCK_REALTIME: return -1;