summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Günter <jan.guenter@googlemail.com>2021-10-16 13:02:06 +0200
committerJan Günter <jan.guenter@googlemail.com>2021-10-16 13:02:06 +0200
commitc8a7c0dc19c74dbd9f15efa5af54977617a405e6 (patch)
tree46e441041883f246d1f14630cf6b6b4536d24730
parent19ff46369532b2aca5dac75b9de1b8cb3eb7b1b1 (diff)
changed static build behavior
restrict getpwuid usage only in static builds with glibc
-rw-r--r--src/linux/btop_collect.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp
index 6d3abaa..6e436e5 100644
--- a/src/linux/btop_collect.cpp
+++ b/src/linux/btop_collect.cpp
@@ -27,7 +27,7 @@ tab-size = 4
#include <ifaddrs.h>
#include <net/if.h>
-#ifndef STATIC_BUILD
+#if !defined(STATIC_BUILD) || !defined(__GLIBC__)
#include <pwd.h>
#endif
@@ -1437,7 +1437,7 @@ namespace Proc {
new_proc.user = uid_user.at(uid);
}
else {
- #ifndef STATIC_BUILD
+ #if !defined(STATIC_BUILD) || !defined(__GLIBC__)
try {
struct passwd* udet;
udet = getpwuid(stoi(uid));