diff options
author | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
commit | f288666edc9180a2e81e6655951878124f321df6 (patch) | |
tree | da70bf44b2423f6f8e9a070c063fed79d190b489 /pcp/PCPDynamicMeter.c | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.gz debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.bz2 debian_htop-f288666edc9180a2e81e6655951878124f321df6.zip |
New upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'pcp/PCPDynamicMeter.c')
-rw-r--r-- | pcp/PCPDynamicMeter.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pcp/PCPDynamicMeter.c b/pcp/PCPDynamicMeter.c index 7c55e4b..e899988 100644 --- a/pcp/PCPDynamicMeter.c +++ b/pcp/PCPDynamicMeter.c @@ -12,12 +12,14 @@ in the source distribution for its full text. #include <ctype.h> #include <dirent.h> #include <errno.h> -#include <pcp/pmapi.h> +#include <pwd.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <pcp/pmapi.h> + #include "Macros.h" #include "Platform.h" #include "RichString.h" @@ -251,6 +253,12 @@ void PCPDynamicMeters_init(PCPDynamicMeters* meters) { const char* home = getenv("HOME"); char* path; + if (!xdgConfigHome && !home) { + const struct passwd* pw = getpwuid(getuid()); + if (pw) + home = pw->pw_dir; + } + meters->table = Hashtable_new(0, true); /* developer paths - PCP_HTOP_DIR=./pcp ./pcp-htop */ |