Use argv[0] to locate the server executable.
This commit is contained in:
parent
079fd72ca7
commit
eafa391081
|
@ -199,7 +199,6 @@ test_pdbstuff()
|
|||
int
|
||||
main(int argc, char * argv[])
|
||||
{
|
||||
extern char * DEBUG_argv0;
|
||||
SIGCONTEXT reg;
|
||||
|
||||
strcpy(vdv, "This is a test");
|
||||
|
@ -207,7 +206,7 @@ main(int argc, char * argv[])
|
|||
vvv.whatsup = 0;
|
||||
vvv.flag3 = 0;
|
||||
vvv.remain = 0x401;
|
||||
DEBUG_argv0 = argv[0];
|
||||
argv0 = argv[0];
|
||||
xxx = (unsigned int*) &vvv;
|
||||
yyy = xxx + 5;
|
||||
xxx3[5] = 7;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define PATH_MAX _MAX_PATH
|
||||
#endif
|
||||
|
||||
#include "options.h"
|
||||
#include "debugger.h"
|
||||
|
||||
#if defined(__svr4__) || defined(__sun)
|
||||
|
@ -70,10 +71,6 @@
|
|||
#define N_EXCL 0xc2
|
||||
#define N_RBRAC 0xe0
|
||||
|
||||
/*
|
||||
* Set so that we know the main executable name and path.
|
||||
*/
|
||||
char * DEBUG_argv0;
|
||||
|
||||
struct stab_nlist {
|
||||
union {
|
||||
|
@ -1317,7 +1314,7 @@ int
|
|||
DEBUG_ReadExecutableDbgInfo(void)
|
||||
{
|
||||
Elf32_Ehdr * ehdr;
|
||||
char * exe_name;
|
||||
const char * exe_name;
|
||||
Elf32_Dyn * dynpnt;
|
||||
struct r_debug * dbg_hdr;
|
||||
struct link_map * lpnt = NULL;
|
||||
|
@ -1329,7 +1326,7 @@ DEBUG_ReadExecutableDbgInfo(void)
|
|||
int rtn = FALSE;
|
||||
int rowcount;
|
||||
|
||||
exe_name = DEBUG_argv0;
|
||||
exe_name = argv0;
|
||||
|
||||
/*
|
||||
* Make sure we can stat and open this file.
|
||||
|
@ -1426,7 +1423,7 @@ DEBUG_ReadExecutableDbgInfo(void)
|
|||
int status;
|
||||
unsigned int stroff;
|
||||
|
||||
exe_name = DEBUG_argv0;
|
||||
exe_name = argv0;
|
||||
|
||||
/*
|
||||
* Make sure we can stat and open this file.
|
||||
|
|
|
@ -971,7 +971,7 @@ INT __cdecl CRTDLL_system(LPSTR x)
|
|||
unsigned char *bp;
|
||||
int i;
|
||||
|
||||
sprintf( buffer, "%s \"", Options.argv0 );
|
||||
sprintf( buffer, "%s \"", argv0 );
|
||||
bp = buffer + strlen(buffer);
|
||||
i = strlen(buffer) + strlen(x) +2;
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ struct options
|
|||
char **argv;
|
||||
char * desktopGeometry; /* NULL when no desktop */
|
||||
char * programName; /* To use when loading resources */
|
||||
char * argv0; /* argv[0] of Wine process */
|
||||
char *dllFlags; /* -dll flags (hack for Winelib support) */
|
||||
int usePrivateMap;
|
||||
int useFixedMap;
|
||||
|
@ -81,6 +80,7 @@ struct options
|
|||
};
|
||||
|
||||
extern struct options Options;
|
||||
extern const char *argv0;
|
||||
|
||||
/* Profile functions */
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ BOOL MZ_InitTask( LPDOSTASK lpDosTask )
|
|||
/* now load dosmod */
|
||||
/* check argv[0]-derived paths first, since the newest dosmod is most likely there
|
||||
* (at least it was once for Andreas Mohr, so I decided to make it easier for him) */
|
||||
fpath=strrchr(strcpy(path,Options.argv0),'/');
|
||||
fpath=strrchr(strcpy(path,argv0),'/');
|
||||
if (fpath) {
|
||||
strcpy(fpath,"/dosmod");
|
||||
execl(path,fname,farg,NULL);
|
||||
|
|
|
@ -58,6 +58,9 @@ DEFAULT_DEBUG_CHANNEL(server)
|
|||
*/
|
||||
BOOL MAIN_MainInit( int *argc, char *argv[] )
|
||||
{
|
||||
/* store the program name */
|
||||
argv0 = argv[0];
|
||||
|
||||
/* Create the initial process */
|
||||
if (!PROCESS_Init()) return 0;
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ struct options Options =
|
|||
NULL, /* argv */
|
||||
NULL, /* desktopGeometry */
|
||||
NULL, /* programName */
|
||||
NULL, /* argv0 */
|
||||
NULL, /* dllFlags */
|
||||
FALSE, /* usePrivateMap */
|
||||
FALSE, /* useFixedMap */
|
||||
|
@ -107,7 +106,9 @@ struct options Options =
|
|||
0 /* screenDepth */
|
||||
};
|
||||
|
||||
static char szUsage[] =
|
||||
const char *argv0;
|
||||
|
||||
static const char szUsage[] =
|
||||
"%s\n"
|
||||
"Usage: %s [options] \"program_name [arguments]\"\n"
|
||||
"\n"
|
||||
|
@ -737,7 +738,6 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
|
|||
Options.argc = argc;
|
||||
Options.argv = argv;
|
||||
Options.programName = MAIN_GetProgramName( *argc, argv );
|
||||
Options.argv0 = argv[0];
|
||||
|
||||
/* initialise Options.language to 0 to tell "no language choosen yet" */
|
||||
Options.language = 0;
|
||||
|
|
|
@ -107,13 +107,6 @@ void MAIN_EmulatorRun( void )
|
|||
int main( int argc, char *argv[] )
|
||||
{
|
||||
NE_MODULE *pModule;
|
||||
extern char * DEBUG_argv0;
|
||||
|
||||
/*
|
||||
* Save this so that the internal debugger can get a hold of it if
|
||||
* it needs to.
|
||||
*/
|
||||
DEBUG_argv0 = argv[0];
|
||||
|
||||
/* Set up debugger hook */
|
||||
EXC_SetDebugEventHook( wine_debugger );
|
||||
|
|
|
@ -307,9 +307,22 @@ static void start_server( const char *oldcwd )
|
|||
if (pid == -1) fatal_perror( "fork" );
|
||||
if (!pid)
|
||||
{
|
||||
char *path, *p;
|
||||
/* first try the installation dir */
|
||||
execl( BINDIR "/wineserver", "wineserver", NULL );
|
||||
if (oldcwd) chdir( oldcwd );
|
||||
/* now try the dir we were launched from */
|
||||
path = xmalloc( strlen(argv0) + 20 );
|
||||
if ((p = strrchr( strcpy( path, argv0 ), '/' )))
|
||||
{
|
||||
strcpy( p, "/wineserver" );
|
||||
execl( path, "wineserver", NULL );
|
||||
strcpy( p, "/server/wineserver" );
|
||||
execl( path, "wineserver", NULL );
|
||||
}
|
||||
/* now try the path */
|
||||
execlp( "wineserver", "wineserver", NULL );
|
||||
/* and finally the current dir */
|
||||
execl( "./server/wineserver", "wineserver", NULL );
|
||||
fatal_error( "could not exec wineserver\n" );
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ static void X11DRV_MONITOR_CreateDesktop(MONITOR *pMonitor)
|
|||
wm_hints->flags = InputHint | StateHint;
|
||||
wm_hints->input = True;
|
||||
wm_hints->initial_state = NormalState;
|
||||
class_hints->res_name = Options.argv[0]; /* FIXME: Options.argv0 insteed? */
|
||||
class_hints->res_name = argv0;
|
||||
class_hints->res_class = "Wine";
|
||||
|
||||
TSXStringListToTextProperty( &name, 1, &window_name );
|
||||
|
|
Loading…
Reference in New Issue