summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVinícius Zavam <egypcio@googlemail.com>2022-11-05 18:38:04 +0000
committerVinícius Zavam <egypcio@googlemail.com>2022-11-05 18:38:04 +0000
commitc98ec6d00157c7114d1e09e8da39110140809ab9 (patch)
tree0e066624fa7d5229557052e771f9b03dd67abda4 /src
parent9c7f919d6ff71f3c0ec227ab89b017465124055a (diff)
downloadtor-c98ec6d00157c7114d1e09e8da39110140809ab9.tar.gz
tor-c98ec6d00157c7114d1e09e8da39110140809ab9.zip
return what OpenBSD gives as base system version
* it also uses sys/param.h to track its version; * present that to tor_libc_get_version_str() as libc version; while here, we also fix the return of FreeBSD version * __FreeBSD_version is the correct var tracking the OSVERSION
Diffstat (limited to 'src')
-rw-r--r--src/lib/osinfo/libc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/osinfo/libc.c b/src/lib/osinfo/libc.c
index 19d089026c..4af8e2f413 100644
--- a/src/lib/osinfo/libc.c
+++ b/src/lib/osinfo/libc.c
@@ -55,8 +55,11 @@ tor_libc_get_version_str(void)
#ifdef __BSD_VISIBLE
#include <sys/param.sh>
#ifdef __FreeBSD__
- return STR(__FreeBSD__);
+ return STR(__FreeBSD_version);
#endif
+#ifdef OpenBSD
+ return STR(OpenBSD);
+#endif /* defined(__BSD_VISIBLE) */
return "N/A";
#endif /* defined(CHECK_LIBC_VERSION) */
}