From 9362aac398e3f2ec680e30c61ebfcb1e407eff72 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 12 Mar 2007 22:52:40 +0000 Subject: 2007-03-11 Havoc Pennington * tools/dbus-launch.c (do_close_stderr): fix C89 problem and formatting problem * Mostly fix the DBusPipe mess. - put line break after function return types - put space before parens - do not pass structs around by value - don't use dbus_strerror after calling supposedly cross-platform api - don't name pipe variables "fd" - abstract special fd numbers like -1 and 1 --- dbus/dbus-sysdeps.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'dbus/dbus-sysdeps.h') diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index 879a47bc..4bdf2cc4 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -303,21 +303,23 @@ dbus_bool_t _dbus_path_is_absolute (const DBusString *filename); dbus_bool_t _dbus_get_standard_session_servicedirs (DBusList **dirs); typedef struct { - int fd; + int fd_or_handle; } DBusPipe; -DBusPipe _dbus_pipe_init(int fd); - -int _dbus_pipe_write (DBusPipe pipe, - const DBusString *buffer, - int start, - int len); - -int _dbus_pipe_close (DBusPipe pipe, - DBusError *error); +void _dbus_pipe_init (DBusPipe *pipe, + int fd); +void _dbus_pipe_init_stdout (DBusPipe *pipe); +int _dbus_pipe_write (DBusPipe *pipe, + const DBusString *buffer, + int start, + int len, + DBusError *error); +int _dbus_pipe_close (DBusPipe *pipe, + DBusError *error); +dbus_bool_t _dbus_pipe_is_valid (DBusPipe *pipe); +void _dbus_pipe_invalidate (DBusPipe *pipe); +dbus_bool_t _dbus_pipe_is_stdout_or_stderr (DBusPipe *pipe); -dbus_bool_t _dbus_pipe_is_valid(DBusPipe pipe); -dbus_bool_t _dbus_pipe_is_special(DBusPipe pipe); /** Opaque type for reading a directory listing */ typedef struct DBusDirIter DBusDirIter; @@ -385,7 +387,7 @@ dbus_bool_t _dbus_full_duplex_pipe (int *fd1, void _dbus_print_backtrace (void); dbus_bool_t _dbus_become_daemon (const DBusString *pidfile, - DBusPipe print_pid_fd, + DBusPipe *print_pid_pipe, DBusError *error); dbus_bool_t _dbus_write_pid_file (const DBusString *filename, unsigned long pid, -- cgit