Check for getuid and avoid the use of it in libwine if we don't have

it.
This commit is contained in:
Steven Edwards 2004-10-04 20:45:49 +00:00 committed by Alexandre Julliard
parent b96edb38cd
commit e7c3ab1874
4 changed files with 12 additions and 1 deletions

2
configure vendored
View File

@ -16276,6 +16276,7 @@ fi
for ac_func in \
@ -16308,6 +16309,7 @@ for ac_func in \
getservbyport \
gettid \
gettimeofday \
getuid \
inet_network \
lseek64 \
lstat \

View File

@ -1083,6 +1083,7 @@ AC_CHECK_FUNCS(\
getservbyport \
gettid \
gettimeofday \
getuid \
inet_network \
lseek64 \
lstat \

View File

@ -191,6 +191,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the <gif_lib.h> header file. */
#undef HAVE_GIF_LIB_H

View File

@ -105,10 +105,15 @@ inline static void remove_trailing_slashes( char *path )
static void init_server_dir( dev_t dev, ino_t ino )
{
char *p;
#ifdef HAVE_GETUID
const unsigned int uid = getuid();
#else
const unsigned int uid = 0;
#endif
server_dir = xmalloc( sizeof(server_root_prefix) + 32 + sizeof(server_dir_prefix) +
2*sizeof(dev) + 2*sizeof(ino) );
sprintf( server_dir, "%s%u%s", server_root_prefix, getuid(), server_dir_prefix );
sprintf( server_dir, "%s%u%s", server_root_prefix, uid, server_dir_prefix );
p = server_dir + strlen(server_dir);
if (sizeof(dev) > sizeof(unsigned long) && dev > ~0UL)