--- gdm-2.6.0.6/daemon/gdm.c.orig	2004-10-27 00:20:01.000000000 +0200
+++ gdm-2.6.0.6/daemon/gdm.c	2004-11-20 10:40:41.085706891 +0100
@@ -3786,6 +3786,7 @@
 		const char *sep = " ";
 		GdmDisplay *disp;
 		GdmLogoutAction logout_action;
+		GString *msg;
 
 		disp = gdm_connection_get_display (conn);
 
@@ -3800,7 +3801,7 @@
 			return;
 		}
 
-		gdm_connection_write (conn, "OK");
+		msg = g_string_new ("OK");
 
 		logout_action = disp->logout_action;
 		if (logout_action == GDM_LOGOUT_ACTION_NONE)
@@ -3809,34 +3810,30 @@
 		if (GdmSystemMenu &&
 		    disp->console &&
 		    ! ve_string_empty (GdmHaltReal)) {
-			gdm_connection_printf (conn, "%s%s",
-					       sep,
-					       GDM_SUP_LOGOUT_ACTION_HALT);
+			g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_HALT);
 			if (logout_action == GDM_LOGOUT_ACTION_HALT)
-				gdm_connection_write (conn, "!");
+				g_string_append (msg, "!");
 			sep = ";";
 		}
 		if (GdmSystemMenu &&
 		    disp->console &&
 		    ! ve_string_empty (GdmRebootReal)) {
-			gdm_connection_printf (conn, "%s%s",
-					       sep,
-					       GDM_SUP_LOGOUT_ACTION_REBOOT);
+			g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_REBOOT);
 			if (logout_action == GDM_LOGOUT_ACTION_REBOOT)
-				gdm_connection_write (conn, "!");
+				g_string_append (msg, "!");
 			sep = ";";
 		}
 		if (GdmSystemMenu &&
 		    disp->console &&
 		    ! ve_string_empty (GdmSuspendReal)) {
-			gdm_connection_printf (conn, "%s%s",
-					       sep,
-					       GDM_SUP_LOGOUT_ACTION_SUSPEND);
+			g_string_append_printf (msg, "%s%s", sep, GDM_SUP_LOGOUT_ACTION_SUSPEND);
 			if (logout_action == GDM_LOGOUT_ACTION_SUSPEND)
-				gdm_connection_write (conn, "!");
+				g_string_append (msg, "!");
 			sep = ";";
 		}
-		gdm_connection_write (conn, "\n");
+		g_string_append (msg, "\n");
+		gdm_connection_write (conn, msg->str);
+		g_string_free (msg, TRUE);
 	} else if (strncmp (msg, GDM_SUP_SET_LOGOUT_ACTION " ",
 		     strlen (GDM_SUP_SET_LOGOUT_ACTION " ")) == 0) {
 		const char *action = 
