Remove MONOTONIC_CLOCK hack since sysconf(3) has support for it now.

This commit is contained in:
ajacoutot 2012-03-06 11:39:17 +00:00
parent bffed54177
commit a7915c237a
4 changed files with 6 additions and 59 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.153 2012/02/21 09:22:33 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.154 2012/03/06 11:39:17 ajacoutot Exp $
COMMENT-main= general-purpose utility library
COMMENT-docs= glib2 documentation
@ -10,7 +10,7 @@ EXTRACT_SUFX= .tar.xz
PKGNAME-main= glib2-${VERSION}
PKGNAME-docs= glib2-docs-${VERSION}
REVISION-main= 6
REVISION-main= 7
CATEGORIES= devel
@ -79,13 +79,7 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
# (check again when updating to a stable release)
CONFIGURE_ARGS += --disable-maintainer-mode
# OpenBSD has support for monotonic clock (CLOCK_MONOTONIC), however we
# currently don't have most of the _POSIX_* defines in unistd.h (e.g.
# _POSIX_MONOTONIC_CLOCK 200112L) and the associated sysconf(3)
# _SC_MONOTONIC_CLOCK variable.
# (see also: patches/patch-gthread_gthread-posix_c)
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include \
-D_POSIX_MONOTONIC_CLOCK=200112L" \
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -pthread"
### kqueue(1) backend ##################################################

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-glib_gmain_c,v 1.8 2011/11/16 15:34:54 ajacoutot Exp $
$OpenBSD: patch-glib_gmain_c,v 1.9 2012/03/06 11:39:17 ajacoutot Exp $
Rewrote upstream, but provides similar functionnality.
(test with GDM that the following does not happen:
@ -6,21 +6,6 @@ Failed to read from child watch wake up pipe: Interrupted system call)
--- glib/gmain.c.orig Fri Nov 11 18:56:52 2011
+++ glib/gmain.c Wed Nov 16 15:46:52 2011
@@ -2054,10 +2054,14 @@ g_get_monotonic_time (void)
{
clockid_t best_clockid;
+#ifndef __OpenBSD__
if (sysconf (_SC_MONOTONIC_CLOCK) >= 0)
best_clockid = CLOCK_MONOTONIC;
else
best_clockid = CLOCK_REALTIME;
+#else
+ best_clockid = CLOCK_MONOTONIC;
+#endif
g_once_init_leave (&clockid, (gsize)best_clockid);
}
#endif
@@ -4564,7 +4568,12 @@ unix_signal_helper_thread (gpointer data)
gboolean sigint_received = FALSE;
gboolean sighup_received = FALSE;

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-gthread_gthread-posix_c,v 1.4 2011/10/19 06:42:44 robert Exp $
--- gthread/gthread-posix.c.orig Wed Oct 19 08:41:50 2011
+++ gthread/gthread-posix.c Wed Oct 19 08:42:24 2011
@@ -119,7 +119,7 @@ static gulong g_thread_min_stack_size = 0;
#define G_MUTEX_SIZE (sizeof (pthread_mutex_t))
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK)
+#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
#define USE_CLOCK_GETTIME 1
static gint posix_clock = 0;
#endif
@@ -148,10 +148,11 @@ g_thread_impl_init(void)
#endif /* HAVE_PRIORITIES */
#ifdef USE_CLOCK_GETTIME
- if (sysconf (_SC_MONOTONIC_CLOCK) >= 0)
+# ifdef CLOCK_MONOTONIC
posix_clock = CLOCK_MONOTONIC;
- else
+# else
posix_clock = CLOCK_REALTIME;
+# endif
#endif
}
#endif /* _SC_THREAD_STACK_MIN || HAVE_PRIORITIES */

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.30 2012/02/21 15:26:26 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.31 2012/03/06 11:39:47 ajacoutot Exp $
COMMENT = multimedia framework
V = 0.10.36
DISTNAME = gstreamer-${V}
REVISION = 1
REVISION = 2
SHARED_LIBS += gstreamer-0.10 3.0 # 30.0
SHARED_LIBS += gstbase-0.10 3.0 # 30.0
@ -26,12 +26,6 @@ BUILD_DEPENDS = devel/flex
LIB_DEPENDS = textproc/libxml \
devel/glib2
# OpenBSD has support for monotonic clock (CLOCK_MONOTONIC), however we
# currently don't have most of the _POSIX_* defines in unistd.h (e.g.
# _POSIX_MONOTONIC_CLOCK 200112L) and the associated sysconf(3)
# _SC_MONOTONIC_CLOCK variable.
CPPFLAGS += -D_POSIX_MONOTONIC_CLOCK=200112L
REGRESS_DEPENDS = ${BASE_PKGPATH}
CONFIGURE_ENV += FLEX_PATH=${LOCALBASE}/bin/gflex \