]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
should we identify __FreeBSD__, return its version
authorVinícius Zavam <egypcio@googlemail.com>
Sat, 5 Nov 2022 18:31:46 +0000 (18:31 +0000)
committerVinícius Zavam <egypcio@googlemail.com>
Sat, 5 Nov 2022 18:31:46 +0000 (18:31 +0000)
  * we use OSVERSION here (defined by __FreeBSD__);
  * it's part of the <sys/param.h> include;
  * that tracks all noteworthy changes made to the base system.

src/lib/osinfo/libc.c

index 59a49e5e63bf10debbe414039e99c3abaa4f25dd..19d089026c80553bf5f5bcafbdf6913caa1862d5 100644 (file)
@@ -52,6 +52,11 @@ tor_libc_get_version_str(void)
     return "N/A";
   return version;
 #else /* !defined(CHECK_LIBC_VERSION) */
+#ifdef __BSD_VISIBLE
+#include <sys/param.sh>
+#ifdef __FreeBSD__
+  return STR(__FreeBSD__);
+#endif
   return "N/A";
 #endif /* defined(CHECK_LIBC_VERSION) */
 }