summaryrefslogtreecommitdiff
path: root/gio/gdbusprivate.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-01-25 12:05:26 -0500
committerColin Walters <walters@verbum.org>2013-01-29 09:46:04 -0500
commitf398bec5bcc0d924e2401c76a6b94133e9490835 (patch)
treed740e8bdc7cd2dadb92e16219cdebc2ed8fad974 /gio/gdbusprivate.c
parentcf68300d27784ab5baaf6ef4761cead0ec404b1f (diff)
downloadglib-f398bec5bcc0d924e2401c76a6b94133e9490835.tar.gz
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
Diffstat (limited to 'gio/gdbusprivate.c')
-rw-r--r--gio/gdbusprivate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c
index cda0b0709..0e5bef2c8 100644
--- a/gio/gdbusprivate.c
+++ b/gio/gdbusprivate.c
@@ -39,6 +39,7 @@
#include "ginputstream.h"
#include "gmemoryinputstream.h"
#include "giostream.h"
+#include "glib/gstdio.h"
#include "gsocketcontrolmessage.h"
#include "gsocketconnection.h"
#include "gsocketoutputstream.h"
@@ -621,7 +622,7 @@ _g_dbus_worker_do_read_cb (GInputStream *input_stream,
{
/* TODO: really want a append_steal() */
g_unix_fd_list_append (worker->read_fd_list, fds[n], NULL);
- close (fds[n]);
+ (void) g_close (fds[n], NULL);
}
}
g_free (fds);