libwine: Remove some conditional code that was only needed for Windows.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-04-03 15:49:15 +02:00
parent f689c723a2
commit 44dc9d7383
4 changed files with 2 additions and 62 deletions

View File

@ -246,11 +246,9 @@ static void init_server_dir( dev_t dev, ino_t ino )
#ifdef __ANDROID__ /* there's no /tmp dir on Android */
root = build_path( config_dir, ".wineserver" );
#elif defined(HAVE_GETUID)
#else
root = xmalloc( sizeof(server_root_prefix) + 12 );
sprintf( root, "%s-%u", server_root_prefix, getuid() );
#else
root = xstrdup( server_root_prefix );
#endif
server_dir = xmalloc( strlen(root) + sizeof(server_dir_prefix) + 2*sizeof(dev) + 2*sizeof(ino) + 2 );
@ -285,8 +283,6 @@ static void init_paths(void)
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() );
@ -300,10 +296,6 @@ static void init_paths(void)
sprintf( uid_str, "%lu", (unsigned long)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 */
user_name = xstrdup( user );
/* build config_dir */
@ -335,10 +327,7 @@ static void init_paths(void)
}
}
if (!S_ISDIR(st.st_mode)) fatal_error( "%s is not a directory\n", config_dir );
#ifdef HAVE_GETUID
if (st.st_uid != getuid()) fatal_error( "%s is not owned by you\n", config_dir );
#endif
init_server_dir( st.st_dev, st.st_ino );
}

View File

@ -33,7 +33,7 @@
#include "winbase.h"
#include "wine/library.h"
#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER)
#ifdef __i386__
#ifdef __linux__

View File

@ -382,7 +382,6 @@ static void fixup_resources( IMAGE_RESOURCE_DIRECTORY *dir, BYTE *root, int delt
/* map a builtin dll in memory and fixup RVAs */
static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
{
#ifdef HAVE_MMAP
IMAGE_DATA_DIRECTORY *dir;
IMAGE_DOS_HEADER *dos;
IMAGE_NT_HEADERS *nt;
@ -504,9 +503,6 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
fixup_exports( exports, addr, delta );
}
return addr;
#else /* HAVE_MMAP */
return NULL;
#endif /* HAVE_MMAP */
}
@ -673,7 +669,6 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists )
*/
static void set_max_limit( int limit )
{
#ifdef HAVE_SETRLIMIT
struct rlimit rlimit;
if (!getrlimit( limit, &rlimit ))
@ -692,7 +687,6 @@ static void set_max_limit( int limit )
#endif
}
}
#endif
}
@ -1017,7 +1011,6 @@ void wine_init( int argc, char *argv[], char *error, int error_size )
*/
void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize )
{
#ifdef HAVE_DLOPEN
void *ret;
const char *s;
@ -1068,16 +1061,6 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
}
dlerror();
return ret;
#else
if (error)
{
static const char msg[] = "dlopen interface not detected by configure";
size_t len = min( errorsize, sizeof(msg) );
memcpy( error, msg, len );
error[len - 1] = 0;
}
return NULL;
#endif
}
/***********************************************************************
@ -1085,7 +1068,6 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize
*/
void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsize )
{
#ifdef HAVE_DLOPEN
void *ret;
const char *s;
dlerror(); dlerror();
@ -1104,16 +1086,6 @@ void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsiz
}
dlerror();
return ret;
#else
if (error)
{
static const char msg[] = "dlopen interface not detected by configure";
size_t len = min( errorsize, sizeof(msg) );
memcpy( error, msg, len );
error[len - 1] = 0;
}
return NULL;
#endif
}
/***********************************************************************
@ -1121,7 +1093,6 @@ void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsiz
*/
int wine_dlclose( void *handle, char *error, size_t errorsize )
{
#ifdef HAVE_DLOPEN
int ret;
const char *s;
dlerror(); dlerror();
@ -1140,14 +1111,4 @@ int wine_dlclose( void *handle, char *error, size_t errorsize )
}
dlerror();
return ret;
#else
if (error)
{
static const char msg[] = "dlopen interface not detected by configure";
size_t len = min( errorsize, sizeof(msg) );
memcpy( error, msg, len );
error[len - 1] = 0;
}
return 1;
#endif
}

View File

@ -45,8 +45,6 @@
#include "wine/library.h"
#include "wine/list.h"
#ifdef HAVE_MMAP
struct reserved_area
{
struct list entry;
@ -684,11 +682,3 @@ int wine_mmap_enum_reserved_areas( int (*enum_func)(void *base, size_t size, voi
}
return ret;
}
#else /* HAVE_MMAP */
void mmap_init(void)
{
}
#endif