openbsd-ports/x11/dbus/patches/patch-dbus_dbus-sysdeps-unix_c
ajacoutot 978381c7b1 Bring some fixes from upstream:
* sync configure.ac patch
* dbus-spawn: set SIGPIPE to SIG_IGN before activating services
* dbus-sysdeps-pthread.c: don't fail if !HAVE_MONOTONIC_CLOCK under -Werror=unused
* Remove redundant close() calls
* Don't leak temporary fds pointing to /dev/null
2013-01-08 09:30:27 +00:00

44 lines
1.7 KiB
Plaintext

$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 <hermier@frugalware.org>
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 ();