Added configure check for getpwuid.
This commit is contained in:
parent
2f4ae7ba2c
commit
142dab8c81
|
@ -11152,6 +11152,7 @@ fi
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_func in \
|
||||
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue