diff options
author | marha <marha@users.sourceforge.net> | 2012-11-07 08:02:14 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-11-07 08:02:14 +0100 |
commit | 2c345c9da4dedfafe791557ca3fcf891ce26249d (patch) | |
tree | 18dc73394bd3921415b57b5847f03a9753374e99 /xorg-server/os/utils.c | |
parent | 7c531937cfab42f2fd3233c096c409ebdd5b59af (diff) | |
parent | 1cc98f5a48924d750fbef7ea6b05a1ba49c28589 (diff) | |
download | vcxsrv-2c345c9da4dedfafe791557ca3fcf891ce26249d.tar.gz vcxsrv-2c345c9da4dedfafe791557ca3fcf891ce26249d.tar.bz2 vcxsrv-2c345c9da4dedfafe791557ca3fcf891ce26249d.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
xserver mesa xkbcomp git update 5 nov 2012
Conflicts:
mesalib/src/glsl/.gitignore
mesalib/src/mesa/main/.gitignore
xorg-server/Xi/chgdctl.c
xorg-server/dix/getevents.c
xorg-server/hw/xwin/winprefs.c
xorg-server/os/utils.c
Diffstat (limited to 'xorg-server/os/utils.c')
-rw-r--r-- | xorg-server/os/utils.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 29ee9ab24..2945e3e1b 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -248,6 +248,19 @@ OsSignal(int sig, OsSigHandlerPtr handler) #define LockFile szLockFile #endif +#if !defined(WIN32) || defined(__CYGWIN__) +#define LOCK_SERVER +#endif + +#ifndef LOCK_SERVER +void +LockServer(void) +{} + +void +UnlockServer(void) +{} +#else /* LOCK_SERVER */ static Bool StillLocking = FALSE; static char LockFile[PATH_MAX]; static Bool nolock = FALSE; @@ -263,7 +276,7 @@ LockServer(void) { #if defined(WIN32) && !defined(__CYGWIN__) char MutexName[100]; - sprintf(MutexName, "Global\\VcXsrv_Mutex_%d\n", getpid()); + sprintf(MutexName, "Global\\VcXsrv_Mutex_%d\n", atoi(display)); if (!CreateMutex(NULL,TRUE,MutexName) || GetLastError()== ERROR_ALREADY_EXISTS) { FatalError("Server is already active for display %d\n", atoi(display)); @@ -404,6 +417,7 @@ UnlockServer(void) (void) unlink(LockFile); } } +#endif /* LOCK_SERVER */ /* Force connections to close on SIGHUP from init */ @@ -530,7 +544,9 @@ UseMsg(void) #ifdef RLIMIT_STACK ErrorF("-ls int limit stack space to N Kb\n"); #endif +#ifdef LOCK_SERVER ErrorF("-nolock disable the locking mechanism\n"); +#endif ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); ErrorF("-background [none] create root window with no background\n"); @@ -692,7 +708,9 @@ ProcessCommandLine(int argc, char *argv[]) if (++i < argc) { displayfd = atoi(argv[i]); display = NULL; +#ifdef LOCK_SERVER nolock = TRUE; +#endif } else UseMsg(); @@ -772,6 +790,7 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } #endif +#ifdef LOCK_SERVER else if (strcmp(argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != 0) @@ -781,6 +800,7 @@ ProcessCommandLine(int argc, char *argv[]) #endif nolock = TRUE; } +#endif else if (strcmp(argv[i], "-nolisten") == 0) { if (++i < argc) { if (_XSERVTransNoListen(argv[i])) |