From 03b9ca6d4ecf2577958530b8390d675c73a58825 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 5 Apr 2003 00:37:17 +0000 Subject: 2003-04-04 Havoc Pennington * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to return a "babysitter" object that is used to monitor the status of the spawned process and reap it when required. * test/test-segfault.c, test/test-exit.c, test/test-sleep-forever.c: binaries that do various lame things, used in the test suite. * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string() --- dbus/dbus-sysdeps.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'dbus/dbus-sysdeps.c') diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index 7e635d9d..624af897 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -2197,7 +2197,7 @@ _dbus_create_file_exclusively (const DBusString *filename, DBUS_ERROR_FAILED, "Could not create file %s: %s\n", filename_c, - _dbus_errno_to_string (errno)); + _dbus_strerror (errno)); return FALSE; } @@ -2207,7 +2207,7 @@ _dbus_create_file_exclusively (const DBusString *filename, DBUS_ERROR_FAILED, "Could not close file %s: %s\n", filename_c, - _dbus_errno_to_string (errno)); + _dbus_strerror (errno)); return FALSE; } @@ -2556,27 +2556,6 @@ _dbus_generate_random_bytes (DBusString *str, return FALSE; } -/** - * A wrapper around strerror() - * - * @todo get rid of this function, it's the same as - * _dbus_strerror(). - * - * @param errnum the errno - * @returns an error message (never #NULL) - */ -const char * -_dbus_errno_to_string (int errnum) -{ - const char *msg; - - msg = strerror (errnum); - if (msg == NULL) - msg = "unknown"; - - return msg; -} - /** * A wrapper around strerror() because some platforms * may be lame and not have strerror(). @@ -2781,13 +2760,15 @@ _dbus_stat (const DBusString *filename, * * @param fd1 return location for one end * @param fd2 return location for the other end + * @param blocking #TRUE if pipe should be blocking * @param error error return * @returns #FALSE on failure (if error is set) */ dbus_bool_t -_dbus_full_duplex_pipe (int *fd1, - int *fd2, - DBusError *error) +_dbus_full_duplex_pipe (int *fd1, + int *fd2, + dbus_bool_t blocking, + DBusError *error) { #ifdef HAVE_SOCKETPAIR int fds[2]; @@ -2801,7 +2782,8 @@ _dbus_full_duplex_pipe (int *fd1, return FALSE; } - if (!_dbus_set_fd_nonblocking (fds[0], NULL) || + if (!blocking && + !_dbus_set_fd_nonblocking (fds[0], NULL) || !_dbus_set_fd_nonblocking (fds[1], NULL)) { dbus_set_error (error, _dbus_error_from_errno (errno), -- cgit