Remove global argc/argv variables.

Was only used in the logging code anymore, and uselessly so there.
This commit is contained in:
Adam Jackson 2008-05-14 15:53:11 -04:00
parent 6c27b91122
commit 2efe1abb6f
4 changed files with 3 additions and 18 deletions

View File

@ -153,7 +153,5 @@ _X_EXPORT int monitorResolution = 0;
_X_EXPORT char *display; _X_EXPORT char *display;
CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
int argcGlobal;
char **argvGlobal;
DDXPointRec dixScreenOrigins[MAXSCREENS]; DDXPointRec dixScreenOrigins[MAXSCREENS];

View File

@ -259,11 +259,6 @@ int main(int argc, char *argv[], char *envp[])
InitConnectionLimits(); InitConnectionLimits();
/* These are needed by some routines which are called from interrupt
* handlers, thus have no direct calling path back to main and thus
* can't be passed argc, argv as parameters */
argcGlobal = argc;
argvGlobal = argv;
/* prep X authority file from environment; this can be overriden by a /* prep X authority file from environment; this can be overriden by a
* command line option */ * command line option */
xauthfile = getenv("XAUTHORITY"); xauthfile = getenv("XAUTHORITY");

View File

@ -49,8 +49,6 @@ extern int ScreenSaverBlanking;
extern int ScreenSaverAllowExposures; extern int ScreenSaverAllowExposures;
extern int defaultScreenSaverBlanking; extern int defaultScreenSaverBlanking;
extern int defaultScreenSaverAllowExposures; extern int defaultScreenSaverAllowExposures;
extern int argcGlobal;
extern char **argvGlobal;
extern char *display; extern char *display;
extern int defaultBackingStore; extern int defaultBackingStore;

View File

@ -410,9 +410,7 @@ AbortServer(void)
exit (1); exit (1);
} }
#ifndef AUDIT_PREFIX #define AUDIT_PREFIX "AUDIT: %s: %ld: "
#define AUDIT_PREFIX "AUDIT: %s: %ld %s: "
#endif
#ifndef AUDIT_TIMEOUT #ifndef AUDIT_TIMEOUT
#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ #define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
#endif #endif
@ -444,15 +442,11 @@ AuditPrefix(void)
autime = ctime(&tm); autime = ctime(&tm);
if ((s = strchr(autime, '\n'))) if ((s = strchr(autime, '\n')))
*s = '\0'; *s = '\0';
if ((s = strrchr(argvGlobal[0], '/'))) len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1;
s++;
else
s = argvGlobal[0];
len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + strlen(s) + 1;
tmpBuf = malloc(len); tmpBuf = malloc(len);
if (!tmpBuf) if (!tmpBuf)
return NULL; return NULL;
snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid(), s); snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid());
return tmpBuf; return tmpBuf;
} }