[hackers] [wmii] libx11-xcb is crap. Don't OCEXEC the X11 socket.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 01 01:58:31 2008

changeset: 2270:e8fd3882ed1d
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Thu Jan 31 19:56:49 2008 -0500
summary: libx11-xcb is crap. Don't OCEXEC the X11 socket.

diff -r 00383ecd917e -r e8fd3882ed1d cmd/wmii/main.c
--- a/cmd/wmii/main.c Thu Jan 31 16:32:24 2008 -0500
+++ b/cmd/wmii/main.c Thu Jan 31 19:56:49 2008 -0500
@@ -334,6 +334,8 @@ spawn_command(const char *cmd) {
         if(doublefork() == 0) {
                 if(setsid() == -1)
                         fatal("Can't setsid: %r");
+ /* Was closeexeced, but Xlib-xcb doesn't like it. */
+ close(ConnectionNumber(display));
 
                 shell = passwd->pw_shell;
                 if(shell[0] != '/')
@@ -396,7 +398,6 @@ main(int argc, char *argv[]) {
         starting = True;
 
         initdisplay();
- closeexec(ConnectionNumber(display));
 
         xlib_errorhandler = XSetErrorHandler(errorhandler);
 
@@ -416,6 +417,10 @@ main(int argc, char *argv[]) {
         sock = ixp_announce(address);
         if(sock < 0)
                 fatal("Can't create socket '%s': %r", address);
+ /* Grr! Xlib-xcb doesn't like this in the least.
+ * And I thought XF86 Xlib was bad... *sigh*
+ closeexec(ConnectionNumber(display));
+ */
         closeexec(sock);
 
         if(wmiirc)
Received on Fri Feb 01 2008 - 01:58:31 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:59:14 UTC