diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-09-11 12:04:04 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2014-09-15 13:31:22 +0200 |
commit | 3765075c5f7c115abd10b0b76df81ae230ffceae (patch) | |
tree | ace36c88949926949239d34c5abfe7cae2c9d34b /dbus/dbus-sysdeps-unix.c | |
parent | 31b38090183b8bd77c86c1195d57b4a3b5df04da (diff) |
Split _dbus_fd_set_close_on_exec into Unix and Windows versions
On Unix, the thing that can be made close-on-exec is a file descriptor,
which is an int.
On Windows, the thing that can be made close-on-exec is a HANDLE,
which is pointer-sized (but not necessarily a pointer!). In practice,
on Windows we only called _dbus_fd_set_close_on_exec() on socket
pseudo-file-descriptors (SOCKET, which is an unsigned int);
every SOCKET can validly be cast to HANDLE, but not every HANDLE
is a SOCKET.
Before this commit we used an intptr_t as a sort of fake
union { int; HANDLE; }, which just obscures what's going on.
In practice, everything that called _dbus_fd_set_close_on_exec()
is really platform-specific anyway, so let's just have two separate
functions and call this solved.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39610
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index acff89e3..a5090d46 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -2919,7 +2919,7 @@ _dbus_disable_sigpipe (void) * @param fd the file descriptor */ void -_dbus_fd_set_close_on_exec (intptr_t fd) +_dbus_fd_set_close_on_exec (int fd) { int val; |