mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Revert 9a82f5c, bring back Cygwin support.
Brought back the code removed in that commit so that we can bring back Cygwin support. Small changes are done in the process of resolving conflicts against the current head. Some checks have not been reverted, because they were not necessary anymore. Signed-off-by: b-aaz <b-aazbsd@proton.me>
This commit is contained in:
@@ -166,7 +166,7 @@ SOFTWARE.
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
@@ -1073,7 +1073,7 @@ ComputeLocalClient(ClientPtr client)
|
||||
*/
|
||||
char *tok = strtok(cmd, ":");
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
ret = strcmp(basename(tok), "ssh") != 0;
|
||||
#else
|
||||
ret = strcmp(tok, "ssh") != 0;
|
||||
|
||||
@@ -103,9 +103,10 @@ _X_EXPORT Bool TimerForce(OsTimerPtr);
|
||||
|
||||
#ifdef WIN32
|
||||
#include <X11/Xwinsock.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if ! defined(__CYGWIN__)
|
||||
typedef _sigset_t sigset_t;
|
||||
#endif
|
||||
|
||||
#undef CreateWindow
|
||||
|
||||
|
||||
10
os/osinit.c
10
os/osinit.c
@@ -94,7 +94,7 @@ OsRegisterSigWrapper(OsSigWrapperPtr newSigWrapper)
|
||||
* OsSigHandler --
|
||||
* Catch unexpected signals and exit or continue cleanly.
|
||||
*/
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
static void
|
||||
#ifdef SA_SIGINFO
|
||||
OsSigHandler(int signo, siginfo_t * sip, void *unused)
|
||||
@@ -144,7 +144,7 @@ OsSigHandler(int signo)
|
||||
FatalError("Caught signal %d (%s). Server aborting\n",
|
||||
signo, strsignal(signo));
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !WIN32 || __CYGWIN__ */
|
||||
|
||||
void
|
||||
OsInit(void)
|
||||
@@ -152,7 +152,7 @@ OsInit(void)
|
||||
static Bool been_here = FALSE;
|
||||
|
||||
if (!been_here) {
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
struct sigaction act, oact;
|
||||
int i;
|
||||
|
||||
@@ -180,7 +180,7 @@ OsInit(void)
|
||||
siglist[i], strerror(errno));
|
||||
}
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !WIN32 || __CYGWIN__ */
|
||||
busfault_init();
|
||||
server_poll = ospoll_create();
|
||||
if (!server_poll)
|
||||
@@ -210,7 +210,7 @@ OsInit(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
if (getpgrp() == 0)
|
||||
setpgid(0, 0);
|
||||
#endif
|
||||
|
||||
22
os/utils.c
22
os/utils.c
@@ -50,7 +50,17 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#if defined(WIN32)
|
||||
#ifdef __CYGWIN__
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
/*
|
||||
Sigh... We really need a prototype for this to know it is stdcall,
|
||||
but #include-ing <windows.h> here is not a good idea...
|
||||
*/
|
||||
__stdcall unsigned long GetTickCount(void);
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#include <X11/Xwinsock.h>
|
||||
#endif
|
||||
#include <X11/Xos.h>
|
||||
@@ -141,7 +151,7 @@ static clockid_t clockid;
|
||||
OsSigHandlerPtr
|
||||
OsSignal(int sig, OsSigHandlerPtr handler)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
return signal(sig, handler);
|
||||
#else
|
||||
struct sigaction act, oact;
|
||||
@@ -187,7 +197,7 @@ ForceClockId(clockid_t forced_clockid)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined WIN32 && defined __MINGW32__)
|
||||
#if (defined WIN32 && defined __MINGW32__) || defined(__CYGWIN__)
|
||||
CARD32
|
||||
GetTimeInMillis(void)
|
||||
{
|
||||
@@ -555,7 +565,7 @@ ProcessCommandLine(int argc, char *argv[])
|
||||
}
|
||||
#ifdef LOCK_SERVER
|
||||
else if (strcmp(argv[i], "-nolock") == 0) {
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) && !defined(__CYGWIN__)
|
||||
if (getuid() != 0)
|
||||
ErrorF
|
||||
("Warning: the -nolock option can only be used by root\n");
|
||||
@@ -990,7 +1000,7 @@ OsAbort(void)
|
||||
#ifndef __APPLE__
|
||||
OsBlockSignals();
|
||||
#endif
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
/* abort() raises SIGABRT, so we have to stop handling that to prevent
|
||||
* recursion
|
||||
*/
|
||||
@@ -1430,7 +1440,7 @@ CheckUserAuthorization(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(WIN32)
|
||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
||||
/* Move a file descriptor out of the way of our select mask; this
|
||||
* is useful for file descriptors which will never appear in the
|
||||
* select mask to avoid reducing the number of clients that can
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
#include <assert.h> /* assertion macros */
|
||||
#include <string.h> /* string functions */
|
||||
|
||||
#if defined(WIN32)
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
#include <X11/Xwinsock.h>
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user