vte r2197 - in trunk: . gnome-pty-helper src



Author: chpe
Date: Wed Nov 26 15:26:40 2008
New Revision: 2197
URL: http://svn.gnome.org/viewvc/vte?rev=2197&view=rev

Log:
	Bug 488960 â gnome-terminal on Solaris 10 does not clean up utmpx on
	exit (intermittent)

	* gnome-pty-helper/gnome-pty-helper.c: (main):
	* gnome-pty-helper/gnome-pty.h:
	* src/pty.c: (_vte_pty_close): Add new GNOME_PTY_SYNCH operation to
	gnome-pty-helper. Patch from Behdad.

Modified:
   trunk/ChangeLog
   trunk/gnome-pty-helper/gnome-pty-helper.c
   trunk/gnome-pty-helper/gnome-pty.h
   trunk/src/pty.c

Modified: trunk/gnome-pty-helper/gnome-pty-helper.c
==============================================================================
--- trunk/gnome-pty-helper/gnome-pty-helper.c	(original)
+++ trunk/gnome-pty-helper/gnome-pty-helper.c	Wed Nov 26 15:26:40 2008
@@ -762,6 +762,13 @@
 			}
 			close_pty_pair (tag);
 			break;
+
+		case GNOME_PTY_SYNCH:
+			{
+				int result = 0;
+				n_write (STDIN_FILENO, &result, 1);
+			}
+			break;
 		}
 
 	}

Modified: trunk/gnome-pty-helper/gnome-pty.h
==============================================================================
--- trunk/gnome-pty-helper/gnome-pty.h	(original)
+++ trunk/gnome-pty-helper/gnome-pty.h	Wed Nov 26 15:26:40 2008
@@ -11,7 +11,8 @@
 	GNOME_PTY_OPEN_PTY_LASTLOGWTMP,
 	GNOME_PTY_OPEN_NO_DB_UPDATE,
 	GNOME_PTY_RESET_TO_DEFAULTS,
-	GNOME_PTY_CLOSE_PTY
+	GNOME_PTY_CLOSE_PTY,
+	GNOME_PTY_SYNCH
 } GnomePtyOps;
 
 void *update_dbs         (int utmp, int wtmp, int lastlog, char *login_name, char *display_name, char *term_name);

Modified: trunk/src/pty.c
==============================================================================
--- trunk/src/pty.c	(original)
+++ trunk/src/pty.c	Wed Nov 26 15:26:40 2008
@@ -1064,9 +1064,10 @@
 		if (g_tree_lookup(_vte_pty_helper_map, GINT_TO_POINTER(pty))) {
 			/* Signal the helper that it needs to close its
 			 * connection. */
-			ops = GNOME_PTY_CLOSE_PTY;
 			tag = g_tree_lookup(_vte_pty_helper_map,
 					    GINT_TO_POINTER(pty));
+
+			ops = GNOME_PTY_CLOSE_PTY;
 			if (n_write(_vte_pty_helper_tunnel,
 				    &ops, sizeof(ops)) != sizeof(ops)) {
 				return;
@@ -1075,6 +1076,14 @@
 				    &tag, sizeof(tag)) != sizeof(tag)) {
 				return;
 			}
+
+			ops = GNOME_PTY_SYNCH;
+			if (n_write(_vte_pty_helper_tunnel,
+				    &ops, sizeof(ops)) != sizeof(ops)) {
+				return;
+			}
+			n_read(_vte_pty_helper_tunnel, &ops, 1);
+
 			/* Remove the item from the map. */
 			g_tree_remove(_vte_pty_helper_map,
 				      GINT_TO_POINTER(pty));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]