Add g_close(), use it
authorColin Walters <walters@verbum.org>
Fri, 25 Jan 2013 17:05:26 +0000 (12:05 -0500)
committerColin Walters <walters@verbum.org>
Tue, 29 Jan 2013 14:46:04 +0000 (09:46 -0500)
commitf398bec5bcc0d924e2401c76a6b94133e9490835
treed740e8bdc7cd2dadb92e16219cdebc2ed8fad974
parentcf68300d27784ab5baaf6ef4761cead0ec404b1f
Add g_close(), use it

There are two benefits to this:

1) We can centralize any operating system specific knowledge of
   close-vs-EINTR handling.  For example, while on Linux we should never
   retry, if someone cared enough later about HP-UX, they could come by
   and change this one spot.
2) For places that do care about the return value and want to provide
   the caller with a GError, this function makes it convenient to do so.

Note that gspawn.c had an incorrect EINTR loop-retry around close().

https://bugzilla.gnome.org/show_bug.cgi?id=682819
15 files changed:
docs/reference/glib/glib-sections.txt
gio/gapplicationimpl-dbus.c
gio/gdbusprivate.c
gio/gdbusserver.c
gio/gdesktopappinfo.c
gio/gfile.c
gio/glocalfile.c
gio/glocalfileinfo.c
gio/glocalfileinputstream.c
gio/glocalfileoutputstream.c
gio/gnetworkmonitornetlink.c
glib/glib-unix.c
glib/gspawn.c
glib/gstdio.c
glib/gstdio.h