diff options
author | itchyny <itchyny@cybozu.co.jp> | 2023-07-19 13:04:19 +0900 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2023-07-19 09:56:41 -0500 |
commit | f1c49473a36bd5068031f2dca4f8cdc7c5dddb70 (patch) | |
tree | c18c732d1508107054cc28c36e2311c1b0fd83ff | |
parent | f0306405c1b9a24453110f9bfb82123cc8ed2604 (diff) |
Avoid getpwuid for static linking
-rw-r--r-- | src/util.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -28,9 +28,6 @@ extern "C" void *alloca (size_t); # endif #endif -#ifndef WIN32 -#include <pwd.h> -#endif #ifdef WIN32 #include <windows.h> @@ -103,11 +100,7 @@ jv get_home() { char *home = getenv("HOME"); if (!home) { #ifndef WIN32 - struct passwd* pwd = getpwuid(getuid()); - if (pwd) - ret = jv_string(pwd->pw_dir); - else - ret = jv_invalid_with_msg(jv_string("Could not find home directory.")); + ret = jv_invalid_with_msg(jv_string("Could not find home directory.")); #else home = getenv("USERPROFILE"); if (!home) { |