diff options
Diffstat (limited to 'build2/b.cxx')
-rw-r--r-- | build2/b.cxx | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/build2/b.cxx b/build2/b.cxx index 1377d5b..633d583 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -8,7 +8,6 @@ #include <stdlib.h> // getenv() #include <unistd.h> // getuid() #include <sys/types.h> // uid_t -#include <pwd.h> // struct passwd, getpwuid() #include <sstream> #include <cstring> // strcmp(), strchr() @@ -202,21 +201,7 @@ main (int argc, char* argv[]) // Figure out work and home directories. // work = dir_path::current (); - - if (const char* h = getenv ("HOME")) - home = dir_path (h); - else - { - struct passwd* pw (getpwuid (getuid ())); - - if (pw == nullptr) - { - const char* msg (strerror (errno)); - fail << "unable to determine home directory: " << msg; - } - - home = dir_path (pw->pw_dir); - } + home = dir_path::home (); if (verb >= 5) { |