Skip to content
Permalink
Browse files

Merge pull request #45 from jeremyhu/master

Check for clock_nanosleep before use
  • Loading branch information
pauldavisthefirst committed Sep 14, 2016
2 parents 0b0953d + 96c3ac0 commit 67f05c995e777c007427f7071e4ae7246390e821
Showing with 16 additions and 2 deletions.
  1. +14 −0 configure.ac
  2. +1 −1 drivers/dummy/dummy_driver.c
  3. +1 −1 drivers/dummy/dummy_driver.h
@@ -285,6 +285,20 @@ AC_CHECK_FUNC(clock_gettime,
])
)

AC_CHECK_FUNC(clock_nanosleep,
[
AC_DEFINE(HAVE_CLOCK_NANOSLEEP,0,"Whether or not clock_nanosleep can be found in system libraries")
],
#
# if not found, check librt specifically
#
AC_CHECK_LIB(rt, clock_nanosleep,
[
AC_DEFINE(HAVE_CLOCK_NANOSLEEP,1,"Whether or not clock_nanosleep can be found in system libraries")
OS_LDFLAGS="$OS_LDFLAGS -lrt"
])
)

# should we use mlockall() on this platform?
if test "x$JACK_DO_NOT_MLOCK" = "x"; then
AC_CHECK_HEADER(sys/mman.h,
@@ -73,7 +73,7 @@ FakeVideoSync ( dummy_driver_t *driver )
}
}

#ifdef HAVE_CLOCK_GETTIME
#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
static inline unsigned long long ts_to_nsec (struct timespec ts)
{
return ts.tv_sec * 1000000000LL + ts.tv_nsec;
@@ -43,7 +43,7 @@ struct _dummy_driver {
jack_nframes_t period_size;
unsigned long wait_time;

#ifdef HAVE_CLOCK_GETTIME
#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_NANOSLEEP)
struct timespec next_wakeup;
#else
jack_time_t next_time;

0 comments on commit 67f05c9

Please sign in to comment.
You can’t perform that action at this time.