diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -35,7 +35,6 @@ #include <string.h> #include <sys/wait.h> #include <ctype.h> -#include <pwd.h> #include "ratpoison.h" @@ -43,6 +42,10 @@ # include <langinfo.h> #endif +#if defined (HAVE_PWD_H) && defined (HAVE_GETPWUID) +#include <pwd.h> +#endif + /* Several systems seem not to have WAIT_ANY defined, so define it if it isn't. */ #ifndef WAIT_ANY @@ -422,6 +425,7 @@ read_startup_files (char *alt_rcfile) $sysconfdir/ratpoisonrc */ homedir = getenv ("HOME"); +#if defined (HAVE_PWD_H) && defined (HAVE_GETPWUID) if (!homedir) { struct passwd *pw; @@ -430,6 +434,7 @@ read_startup_files (char *alt_rcfile) if (pw) homedir = pw->pw_dir; } +#endif if (!homedir) PRINT_ERROR (("ratpoison: no home directory!?\n")); |