Switch all open() calls to use g_open()

Because it now handles EINTR.  And we should do so.  While most people
use Linux, which tries very hard to avoid propagating EINTR back up
into userspace, it can still happen.

https://bugzilla.gnome.org/show_bug.cgi?id=682833
This commit is contained in:
Colin Walters
2012-08-27 18:30:06 -04:00
parent 2542b6f604
commit 6e64ba58b9
9 changed files with 17 additions and 16 deletions

View File

@@ -178,7 +178,7 @@ test_interface_method_call (GDBusConnection *connection,
error = NULL;
fd = open (path, O_RDONLY);
fd = g_open (path, O_RDONLY, 0);
g_unix_fd_list_append (fd_list, fd, &error);
g_assert_no_error (error);
close (fd);

View File

@@ -19,6 +19,7 @@
*/
#include <gio/gio.h>
#include <glib/gstdio.h>
#ifdef G_OS_UNIX
#include <fcntl.h>
@@ -154,7 +155,7 @@ test_pollable_unix (void)
g_object_unref (out);
/* Non-pipe/socket unix streams are not pollable */
fd = open ("/dev/null", O_RDWR);
fd = g_open ("/dev/null", O_RDWR, 0);
g_assert_cmpint (fd, !=, -1);
in = G_POLLABLE_INPUT_STREAM (g_unix_input_stream_new (fd, FALSE));
out = g_unix_output_stream_new (fd, FALSE);