aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os')
-rw-r--r--xorg-server/os/connection.c2
-rw-r--r--xorg-server/os/io.c12
-rw-r--r--xorg-server/os/osinit.c1
-rw-r--r--xorg-server/os/utils.c18
4 files changed, 24 insertions, 9 deletions
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 50ed4ae69..f34cc3ea3 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -929,7 +929,7 @@ ErrorConnMax(XtransConnInfo trans_conn)
{
int fd = _XSERVTransGetConnectionNumber(trans_conn);
xConnSetupPrefix csp;
- char pad[3];
+ char pad[3] = { 0, 0, 0 };
struct iovec iov[3];
char byteOrder = 0;
int whichbyte = 1;
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index 84757294b..9ccfdba62 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -578,8 +578,6 @@ ResetCurrentRequest(ClientPtr client)
}
}
-static const int padlength[4] = { 0, 3, 2, 1 };
-
/********************
* FlushAllOutput()
* Flush all clients with output. However, if some client still
@@ -757,7 +755,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
oc->output = oco;
}
- padBytes = padlength[count & 3];
+ padBytes = padding_for_int32(count);
if (ReplyCallback) {
ReplyInfoRec replyinfo;
@@ -815,7 +813,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
NewOutputPending = TRUE;
FD_SET(oc->fd, &OutputPending);
memmove((char *) oco->buf + oco->count, buf, count);
- oco->count += count + padBytes;
+ oco->count += count;
+ if (padBytes) {
+ memset(oco->buf + oco->count, '\0', padBytes);
+ oco->count += padBytes;
+ }
return count;
}
@@ -846,7 +848,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
if (!oco)
return 0;
written = 0;
- padsize = padlength[extraCount & 3];
+ padsize = padding_for_int32(extraCount);
notWritten = oco->count + extraCount + padsize;
todo = notWritten;
while (notWritten) {
diff --git a/xorg-server/os/osinit.c b/xorg-server/os/osinit.c
index c2cff757b..8a959a39c 100644
--- a/xorg-server/os/osinit.c
+++ b/xorg-server/os/osinit.c
@@ -291,6 +291,7 @@ OsInit(void)
}
TimerInit();
OsVendorInit();
+ OsResetSignals();
/*
* No log file by default. OsVendorInit() should call LogInit() with the
* log file name if logging to a file is desired.
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index d61a9d67d..b1bd5ce94 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -138,7 +138,6 @@ Bool noDPMSExtension = FALSE;
#endif
#ifdef GLXEXT
Bool noGlxExtension = FALSE;
-Bool noGlxVisualInit = FALSE;
#endif
#ifdef SCREENSAVER
Bool noScreenSaverExtension = FALSE;
@@ -785,8 +784,8 @@ ProcessCommandLine(int argc, char *argv[])
else if (strcmp(argv[i], "-nolisten") == 0) {
if (++i < argc) {
if (_XSERVTransNoListen(argv[i]))
- FatalError("Failed to disable listen for %s transport",
- argv[i]);
+ ErrorF("Failed to disable listen for %s transport",
+ argv[i]);
}
else
UseMsg();
@@ -1302,6 +1301,19 @@ OsReleaseSignals(void)
#endif
}
+void
+OsResetSignals(void)
+{
+#ifdef SIG_BLOCK
+ while (BlockedSignalCount > 0)
+ OsReleaseSignals();
+#ifdef SIGIO
+ while (sigio_blocked > 0)
+ OsReleaseSIGIO();
+#endif
+#endif
+}
+
/*
* Pending signals may interfere with core dumping. Provide a
* mechanism to block signals when aborting.