Commit 142dab8c authored by Alexandre Julliard's avatar Alexandre Julliard

Added configure check for getpwuid.

parent 2f4ae7ba
......@@ -11154,6 +11154,7 @@ fi
for ac_func in \
__libc_fork \
_lwp_create \
......@@ -11174,6 +11175,7 @@ for ac_func in \
getpagesize \
getprotobyname \
getprotobynumber \
getpwuid \
getservbyport \
getsockopt \
inet_network \
......
......@@ -860,6 +860,7 @@ AC_CHECK_FUNCS(\
getpagesize \
getprotobyname \
getprotobynumber \
getpwuid \
getservbyport \
getsockopt \
inet_network \
......
......@@ -134,6 +134,9 @@
/* Define to 1 if you have the `getprotobynumber' function. */
#undef HAVE_GETPROTOBYNUMBER
/* Define to 1 if you have the `getpwuid' function. */
#undef HAVE_GETPWUID
/* Define to 1 if you have the `getservbyport' function. */
#undef HAVE_GETSERVBYPORT
......
......@@ -91,11 +91,14 @@ inline static void remove_trailing_slashes( char *path )
static void init_paths(void)
{
struct stat st;
char uid_str[32], *p;
char *p;
const char *home = getenv( "HOME" );
const char *user = NULL;
const char *prefix = getenv( "WINEPREFIX" );
#ifdef HAVE_GETPWUID
char uid_str[32];
struct passwd *pwd = getpwuid( getuid() );
if (pwd)
......@@ -108,6 +111,10 @@ static void init_paths(void)
sprintf( uid_str, "%d", getuid() );
user = uid_str;
}
#else /* HAVE_GETPWUID */
if (!(user = getenv( "USER" )))
fatal_error( "cannot determine your user name, set the USER environment variable\n" );
#endif /* HAVE_GETPWUID */
/* build config_dir */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment