From 84bb7fbef454a73392dc45d383bc35c89d1dccdd Mon Sep 17 00:00:00 2001 From: Antoine Jacoutot Date: Wed, 19 Feb 2014 09:21:49 +0100 Subject: [PATCH] portability: get/setnetgrent is different on OpenBSD On OpenBSD, get/setnetgrent are defined in netgroup.h and getnetgrent(3) takes a const char. --- configure.ac | 4 ++++ src/polkitbackend/polkitbackendinteractiveauthority.c | 8 ++++++++ src/polkitbackend/polkitbackendjsauthority.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index a2a866b..634c7b2 100644 --- a/configure.ac +++ b/configure.ac @@ -169,7 +169,11 @@ dnl - Check whether setnetgrent has a return value dnl --------------------------------------------------------------------------- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include +#ifndef __OpenBSD__ #include +#else + #include +#endif ]], [[ int r = setnetgrent (NULL);]])], [AC_DEFINE([HAVE_SETNETGRENT_RETURN], 1, [Define to 1 if setnetgrent has return value])]) diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c index 59028d5..01e55be 100644 --- a/src/polkitbackend/polkitbackendinteractiveauthority.c +++ b/src/polkitbackend/polkitbackendinteractiveauthority.c @@ -23,7 +23,11 @@ #include #include #include +#if defined HAVE_OPENBSD +#include +#else #include +#endif #include #include #include @@ -2125,7 +2129,11 @@ get_users_in_net_group (PolkitIdentity *group, for (;;) { +#if defined HAVE_OPENBSD + const char *hostname, *username, *domainname; +#else char *hostname, *username, *domainname; +#endif PolkitIdentity *user; GError *error = NULL; diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c index c507595..eb9da0d 100644 --- a/src/polkitbackend/polkitbackendjsauthority.c +++ b/src/polkitbackend/polkitbackendjsauthority.c @@ -24,7 +24,11 @@ #include #include #include +#if defined HAVE_OPENBSD +#include +#else #include +#endif #include #include #include -- 1.8.5.3