GNOME Bugzilla – Bug 104825
PATCH: gspawn cleanup
Last modified: 2011-02-18 15:57:04 UTC
Attached is a patch that makes gspawn a little more robust and 1 minor change that makes something more clear.
Created attachment 13956 [details] [review] gspawn.patch
er, doh. type-o in my patch
Created attachment 13957 [details] [review] gspawn.patch w/o the type-o :-)
- Did this fix the problem you were running into? - To be _real_ picky, I'm not that fond of the double loop in your full_write() function. My idea of "best practices" for this is somethign like write_all() gdk/x11/linux-fb/gdkmouse-fb.c: == static gboolean write_all (gint fd, gchar *buf, gsize to_write) { while (to_write > 0) { gssize count = write (fd, buf, to_write); if (count < 0) { if (errno != EINTR) return FALSE; } else { to_write -= count; buf += count; } } return TRUE; } ==
Created attachment 13962 [details] [review] new gspawn.patch using write_all()
*poke* this should go into both 2.0.x and 2.2.x preferably
You indicated earlier that this doesn't actually fix any reproducible bugs, so I didn't figure there was urgency to get to it before we next worked on a 2.2.x release. 2.0.x is dead, as announced, no future releases will be made off the gtk-2-0 branch. (Did you mean 2.2 and head?)
well, I meant 2.0 and 2.2 - but since 2.0 is dead, I guess 2.2 and head, yea :) I suppose there's no urgency
Applied to both branches with the tiny change of using glib types in the write_all() prototype. looking at it, it's a bit weird that we have different styles and naming for read_data() and write_all(), but not weird enough that I'm going to bother changing things.