Commit 0371276f authored by Mike Gabriel's avatar Mike Gabriel

hw/nxagent/: Stop using non-portable '__progname', set up our own…

hw/nxagent/: Stop using non-portable '__progname', set up our own 'nxagentProgName' instead and pass it around where needed.
parent 99fb9817
...@@ -124,7 +124,7 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth); ...@@ -124,7 +124,7 @@ extern int _XGetBitsPerPixel(Display *dpy, int depth);
extern char dispatchExceptionAtReset; extern char dispatchExceptionAtReset;
extern const char *__progname; const char *nxagentProgName;
char nxagentDisplayName[NXAGENTDISPLAYNAMELENGTH]; char nxagentDisplayName[NXAGENTDISPLAYNAMELENGTH];
Bool nxagentSynchronize = False; Bool nxagentSynchronize = False;
...@@ -185,6 +185,8 @@ int ddxProcessArgument(int argc, char *argv[], int i) ...@@ -185,6 +185,8 @@ int ddxProcessArgument(int argc, char *argv[], int i)
* Ensure that the options are set to their defaults. * Ensure that the options are set to their defaults.
*/ */
nxagentProgName = argv[0];
static Bool resetOptions = True; static Bool resetOptions = True;
if (resetOptions == True) if (resetOptions == True)
...@@ -1185,13 +1187,13 @@ static void nxagentParseOptions(char *name, char *value) ...@@ -1185,13 +1187,13 @@ static void nxagentParseOptions(char *name, char *value)
{ {
#if !defined(PANORAMIX) && !defined(RANDR) #if !defined(PANORAMIX) && !defined(RANDR)
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, 0);
fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", __progname); fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName);
return; return;
#else #else
if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND)
{ {
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, 0);
fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", __progname); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName);
return; return;
} }
......
...@@ -194,8 +194,8 @@ int nxagentX2go; ...@@ -194,8 +194,8 @@ int nxagentX2go;
void checkX2goAgent() void checkX2goAgent()
{ {
extern const char *__progname; extern const char *nxagentProgName;
if( strcasecmp(__progname,"x2goagent") == 0) if( strcasecmp(nxagentProgName,"x2goagent") == 0)
{ {
fprintf(stderr, "\nrunning as X2Go Agent\n"); fprintf(stderr, "\nrunning as X2Go Agent\n");
nxagentX2go=1; nxagentX2go=1;
......
...@@ -557,8 +557,8 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay) ...@@ -557,8 +557,8 @@ AdjustWaitForDelay (void * waitTime, unsigned long newdelay)
void UseMsg(void) void UseMsg(void)
{ {
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
extern const char *__progname; extern const char *nxagentProgName;
ErrorF("Usage: %s [<options>] [:<display>]\n\n", __progname); ErrorF("Usage: %s [<options>] [:<display>]\n\n", nxagentProgName);
#else #else
ErrorF("use: X [:<display>] [option]\n"); ErrorF("use: X [:<display>] [option]\n");
#endif #endif
......
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