Package: gentoo
Version: 0.11.56-1+b1
Followup-For: Bug #487949

Hi,

I've put together a patch to get gentoo back to work based on mh's info
above.

It looks like that construct is leaking errno from somewhere. I think
there were already a couple of places where it was isolated so it
wouldn't pollute errno - I just extended that to all ocurrances.

I suspect someone who knows what they're doing (ie not me ^_^) should look
at gtk_events_pending() and/or gtk_main_iteration() and see why they
want to ste errno...

Ta,
Nyk
-- 
/__
\_|\/
   /\
diff -Nur gentoo-0.11.56/src/cmd_direnter.c gentoo-0.11.56.0.0.0.1/src/cmd_direnter.c
--- gentoo-0.11.56/src/cmd_direnter.c	2004-12-27 20:18:00.000000000 +0000
+++ gentoo-0.11.56.0.0.0.1/src/cmd_direnter.c	2008-07-26 17:19:22.000000000 +0100
@@ -97,8 +97,10 @@
 			** the history state; if not resized, vpos setting will likely fail.
 			*/
 			gtk_widget_queue_resize(GTK_WIDGET(src->list));
+			gint    old_errno = errno; /* save/restore errno around loop */
 			while(gtk_events_pending())
 				gtk_main_iteration();
+			errno=old_errno;
 			dph_state_restore(src);
 			dp_focus_enter_dir(src);
 		}
diff -Nur gentoo-0.11.56/src/cmd_select.c gentoo-0.11.56.0.0.0.1/src/cmd_select.c
--- gentoo-0.11.56/src/cmd_select.c	2005-06-04 20:59:59.000000000 +0100
+++ gentoo-0.11.56.0.0.0.1/src/cmd_select.c	2008-07-26 17:31:54.000000000 +0100
@@ -126,8 +126,10 @@
 		action = car_keyword_get_enum(ca, "action", 0, "select", "unselect", "toggle", NULL);
 		afunc = (action == 0) ? dp_select : (action == 1) ? dp_unselect : dp_toggle;
 		afunc(src, row);
+		gint oe=errno; /* save/restore errno around loop */
 		while(gtk_events_pending())
 			gtk_main_iteration();
+		errno=oe;
 	}
 	return 1;
 }
diff -Nur gentoo-0.11.56/src/dirpane.c gentoo-0.11.56.0.0.0.1/src/dirpane.c
--- gentoo-0.11.56/src/dirpane.c	2004-05-02 13:47:33.000000000 +0100
+++ gentoo-0.11.56.0.0.0.1/src/dirpane.c	2008-07-26 17:37:48.000000000 +0100
@@ -541,8 +541,10 @@
 		{
 			dp->dbclk_row = row;
 			dp_unselect(dp, row);
+			gint oe=errno; /* save/restore errno around loop */
 			while(gtk_events_pending())
 				gtk_main_iteration();
+			errno=oe;
 			doubleclick(dp);
 			dp->dbclk_row = -1;
 			last_time = ev->time;
diff -Nur gentoo-0.11.56/src/guiutil.c gentoo-0.11.56.0.0.0.1/src/guiutil.c
--- gentoo-0.11.56/src/guiutil.c	2003-10-24 10:16:46.000000000 +0100
+++ gentoo-0.11.56.0.0.0.1/src/guiutil.c	2008-07-26 17:30:26.000000000 +0100
@@ -126,8 +126,10 @@
 		if((obj != NULL) && (pbar->obj != NULL))
 			gtk_label_set_text(GTK_LABEL(pbar->obj), obj);
 
+		gint oe=errno; /* save/restore errno around loop */
 		while(gtk_events_pending())
 			gtk_main_iteration();
+		errno=oe;
 	}
 	return pbar->terminate;
 }
diff -Nur gentoo-0.11.56/src/menus.c gentoo-0.11.56.0.0.0.1/src/menus.c
--- gentoo-0.11.56/src/menus.c	2004-04-18 20:04:16.000000000 +0100
+++ gentoo-0.11.56.0.0.0.1/src/menus.c	2008-07-26 17:34:33.000000000 +0100
@@ -465,6 +465,7 @@
 
 static gboolean evt_popup_destroy(GtkWidget *wid, GdkEvent *evt, gpointer user)
 {
+	gint oe=errno; /* save/restore errno around loop */
 /*	fprintf(stderr, "Widget at %p being destroyed\n", wid);
 	printf("Popped-up menu hiding: [");
 */	while(gtk_events_pending())
@@ -473,6 +474,7 @@
 /*		putchar('.');*/
 	}
 /*	printf("]\n");*/
+	errno=oe;
 
 	return FALSE;
 }
diff -Nur gentoo-0.11.56/src/progress.c gentoo-0.11.56.0.0.0.1/src/progress.c
--- gentoo-0.11.56/src/progress.c	2004-05-01 21:56:12.000000000 +0100
+++ gentoo-0.11.56.0.0.0.1/src/progress.c	2008-07-26 17:58:40.000000000 +0100
@@ -270,8 +270,10 @@
 		g_snprintf(buf, sizeof buf, "%s (%s)", name, size_buf);
 		gtk_label_set_text(GTK_LABEL(pgs_info.item), buf);
 	}
+	gint oe=errno; /* save/restore errno around loop */
 	while(gtk_events_pending())
 		gtk_main_iteration();
+	errno=oe;
 }
 
 /* 1998-09-30 -	Indicate progress operating on the most recently registered item. Our
@@ -323,8 +325,10 @@
 			gtk_progress_bar_update(GTK_PROGRESS_BAR(pgs_info.byte_pgs), (gfloat) (pgs_info.byte_pos + pos) / pgs_info.byte_tot);
 		if(pgs_info.show_item && pgs_info.item_size)
 			gtk_progress_bar_update(GTK_PROGRESS_BAR(pgs_info.item_pgs), (gfloat) pos / pgs_info.item_size);
+		gint oe=errno; /* save/restore errno around loop */
 		while(gtk_events_pending())
 			gtk_main_iteration();
+		errno=oe;
 		if(pgs_info.cancel)
 			return PGS_CANCEL;
 	}
diff -Nur gentoo-0.11.56/src/window.c gentoo-0.11.56.0.0.0.1/src/window.c
--- gentoo-0.11.56/src/window.c	2005-10-30 21:35:52.000000000 +0000
+++ gentoo-0.11.56.0.0.0.1/src/window.c	2008-07-26 17:33:04.000000000 +0100
@@ -624,9 +624,11 @@
 
 	if((wd != NULL) && wd->pos_use && (wd->x >= 0))
 	{
+		gint oe=errno; /* save/restore errno around loop */
 		while(gtk_events_pending())
 			gtk_main_iteration();
 		gtk_widget_set_uposition(GTK_WIDGET(window), wd->x, wd->y);
+		errno=oe;
 	}
 }
 

Reply via email to