After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104825 - PATCH: gspawn cleanup
PATCH: gspawn cleanup
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-01-30 16:58 UTC by Jeffrey Stedfast
Modified: 2011-02-18 15:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gspawn.patch (2.61 KB, patch)
2003-01-30 16:58 UTC, Jeffrey Stedfast
none Details | Review
gspawn.patch w/o the type-o :-) (2.61 KB, patch)
2003-01-30 17:02 UTC, Jeffrey Stedfast
none Details | Review
new gspawn.patch using write_all() (2.64 KB, patch)
2003-01-30 18:02 UTC, Jeffrey Stedfast
none Details | Review

Description Jeffrey Stedfast 2003-01-30 16:58:01 UTC
Attached is a patch that makes gspawn a little more robust and 1 minor
change that makes something more clear.
Comment 1 Jeffrey Stedfast 2003-01-30 16:58:47 UTC
Created attachment 13956 [details] [review]
gspawn.patch
Comment 2 Jeffrey Stedfast 2003-01-30 17:01:37 UTC
er, doh. type-o in my patch
Comment 3 Jeffrey Stedfast 2003-01-30 17:02:59 UTC
Created attachment 13957 [details] [review]
gspawn.patch w/o the type-o :-)
Comment 4 Owen Taylor 2003-01-30 17:16:51 UTC
- 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;
}
==
Comment 5 Jeffrey Stedfast 2003-01-30 18:02:42 UTC
Created attachment 13962 [details] [review]
new gspawn.patch using write_all()
Comment 6 Jeffrey Stedfast 2003-03-03 04:29:53 UTC
*poke*

this should go into both 2.0.x and 2.2.x preferably
Comment 7 Owen Taylor 2003-03-03 13:44:18 UTC
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?)
Comment 8 Jeffrey Stedfast 2003-03-03 16:28:50 UTC
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
Comment 9 Owen Taylor 2003-06-02 18:22:30 UTC
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.