From 163555c7ab56132ee27e3e7d9a26eb985682c1b5 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 17 Aug 2007 16:43:57 +0000 Subject: 2007-08-17 Havoc Pennington * tools/dbus-launch-x11.c (set_address_in_x11): fix from Michael Lorenz to use long not int with XChangeProperty format 32 * dbus/dbus-sysdeps-util-unix.c (_dbus_write_pid_to_file_and_pipe): factor this out, and use the same code in _dbus_become_daemon (where the parent writes the pid file and to the pid pipe) and in bus_context_new (where the daemon writes its own pid file and to its own pid pipe) * bus/bus.c (bus_context_new): close the pid pipe after we print to it. Also, don't write the pid to the pipe twice when we fork, someone reported this bug a long time ago. --- tools/dbus-launch-x11.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/dbus-launch-x11.c b/tools/dbus-launch-x11.c index dfb28445..927d8634 100644 --- a/tools/dbus-launch-x11.c +++ b/tools/dbus-launch-x11.c @@ -342,7 +342,7 @@ set_address_in_x11(char *address, pid_t pid) { char *current_address; Window wid; - int pid32; + unsigned long pid32; /* Xlib property functions want _long_ not 32-bit for format "32" */ /* lock the X11 display to make sure we're doing this atomically */ XGrabServer (xdisplay); @@ -372,11 +372,6 @@ set_address_in_x11(char *address, pid_t pid) XChangeProperty (xdisplay, wid, address_atom, XA_STRING, 8, PropModeReplace, (unsigned char *)address, strlen (address)); pid32 = pid; - if (sizeof(pid32) != 4) - { - fprintf (stderr, "int is not 32 bits!\n"); - exit (1); - } XChangeProperty (xdisplay, wid, pid_atom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&pid32, 1); -- cgit