$OpenBSD: patch-dbus_dbus-sysdeps-unix_c,v 1.12 2013/01/08 09:30:27 ajacoutot Exp $ From pkgsrc: _dbus_poll: set the timeout value argument to poll to -1 whenever it is less than -1 to avoid an infinite EINVAL loop. From b8b3feb98646c8294c86f8391d243aaf3f8ac684 Mon Sep 17 00:00:00 2001 From: Michel HERMIER Date: Fri, 09 Nov 2012 15:53:46 +0000 Subject: Remove redundant close() calls --- dbus/dbus-sysdeps-unix.c.orig Fri Sep 28 21:31:47 2012 +++ dbus/dbus-sysdeps-unix.c Tue Jan 8 09:55:49 2013 @@ -2525,6 +2525,10 @@ _dbus_poll (DBusPollFD *fds, _DBUS_STRUCT_OFFSET (DBusPollFD, revents) == _DBUS_STRUCT_OFFSET (struct pollfd, revents)) { + if (timeout_milliseconds < -1) { + _dbus_warn("_dbus_poll: timeout = %d (fixed)\n", timeout_milliseconds); + timeout_milliseconds = -1; + } return poll ((struct pollfd*) fds, n_fds, timeout_milliseconds); @@ -3299,15 +3303,12 @@ _read_subprocess_line_argv (const char *progpath, /* set-up stdXXX */ close (result_pipe[READ_END]); close (errors_pipe[READ_END]); - close (0); /* close stdin */ - close (1); /* close stdout */ - close (2); /* close stderr */ - if (dup2 (fd, 0) == -1) + if (dup2 (fd, 0) == -1) /* setup stdin */ _exit (1); - if (dup2 (result_pipe[WRITE_END], 1) == -1) + if (dup2 (result_pipe[WRITE_END], 1) == -1) /* setup stdout */ _exit (1); - if (dup2 (errors_pipe[WRITE_END], 2) == -1) + if (dup2 (errors_pipe[WRITE_END], 2) == -1) /* setup stderr */ _exit (1); _dbus_close_all ();