From 68ea74985231880a7c113aacefe19445c010a320 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 31 Mar 2009 15:45:07 +0200 Subject: allow compilation with older version of dbus --- server/configure.ac | 6 ++++++ server/sbus/sssd_dbus_connection.c | 4 ++++ server/sbus/sssd_dbus_server.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/server/configure.ac b/server/configure.ac index a61289c3..af77da6d 100644 --- a/server/configure.ac +++ b/server/configure.ac @@ -51,6 +51,12 @@ m4_include(ldap.m4) m4_include(util/signal.m4) PKG_CHECK_MODULES([DBUS],[dbus-1]) +if test x$has_dbus != xno; then + LDFLAGS="$DBUS_LIBS" + AC_CHECK_FUNC([dbus_watch_get_unix_fd], + AC_DEFINE([HAVE_DBUS_WATCH_GET_UNIX_FD], [1], + [Define if dbus_watch_get_unix_fd exists])) +fi if test x$HAVE_TESTS != x; then PKG_CHECK_MODULES([CHECK],[check]) fi diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index 3629957e..9c33d224 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -170,7 +170,11 @@ static dbus_bool_t sbus_add_conn_watch(DBusWatch *watch, void *data) conn_w_ctx->watch = watch; flags = dbus_watch_get_flags(watch); +#ifdef HAVE_DBUS_WATCH_GET_UNIX_FD conn_w_ctx->fd = dbus_watch_get_unix_fd(watch); +#else + conn_w_ctx->fd = dbus_watch_get_fd(watch); +#endif event_flags = 0; diff --git a/server/sbus/sssd_dbus_server.c b/server/sbus/sssd_dbus_server.c index e30f9abf..ec01c77c 100644 --- a/server/sbus/sssd_dbus_server.c +++ b/server/sbus/sssd_dbus_server.c @@ -102,7 +102,11 @@ static dbus_bool_t sbus_add_srv_watch(DBusWatch *watch, void *data) svw_ctx->watch = watch; flags = dbus_watch_get_flags(watch); +#ifdef HAVE_DBUS_WATCH_GET_UNIX_FD svw_ctx->fd = dbus_watch_get_unix_fd(watch); +#else + svw_ctx->fd = dbus_watch_get_fd(watch); +#endif event_flags = 0; -- cgit