summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2014-01-20 15:34:53 +0800
committerColin Walters <walters@verbum.org>2014-02-18 19:25:41 -0500
commit815dfc64d40cb0267cb96701409c04b4196e508a (patch)
treea3a10fd9895926609c3c76fca0cf1d7046ddfd57 /src
parentfb0d00225c401a521430ddf232a11965cdc5dd44 (diff)
downloadpolkit-815dfc64d40cb0267cb96701409c04b4196e508a.tar.gz
build: Fix several issues on FreeBSD
1. Fallback to fsync() if fdatasync() is not available. 2. Check whether setnetgrent() has a return value. 3. Check whether the system has SIGPOLL. 4. Add configure option to disable test. mocklibc cannot be built on FreeBSD because of function prototype conflict. https://bugs.freedesktop.org/show_bug.cgi?id=73821
Diffstat (limited to 'src')
-rw-r--r--src/polkitagent/polkitagenthelperprivate.c5
-rw-r--r--src/polkitbackend/polkitbackendinteractiveauthority.c4
-rw-r--r--src/polkitbackend/polkitbackendjsauthority.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/src/polkitagent/polkitagenthelperprivate.c b/src/polkitagent/polkitagenthelperprivate.c
index 4417e70..cfa77fc 100644
--- a/src/polkitagent/polkitagenthelperprivate.c
+++ b/src/polkitagent/polkitagenthelperprivate.c
@@ -103,7 +103,12 @@ flush_and_wait ()
{
fflush (stdout);
fflush (stderr);
+#ifdef HAVE_FDATASYNC
fdatasync (fileno(stdout));
fdatasync (fileno(stderr));
+#else
+ fsync (fileno(stdout));
+ fsync (fileno(stderr));
+#endif
usleep (100 * 1000);
}
diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
index 3bd2f0b..59028d5 100644
--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
+++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
@@ -2113,11 +2113,15 @@ get_users_in_net_group (PolkitIdentity *group,
ret = NULL;
name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group));
+#ifdef HAVE_SETNETGRENT_RETURN
if (setnetgrent (name) == 0)
{
g_warning ("Error looking up net group with name %s: %s", name, g_strerror (errno));
goto out;
}
+#else
+ setnetgrent (name);
+#endif
for (;;)
{
diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
index c3885a9..c507595 100644
--- a/src/polkitbackend/polkitbackendjsauthority.c
+++ b/src/polkitbackend/polkitbackendjsauthority.c
@@ -1286,7 +1286,9 @@ get_signal_name (gint signal_number)
_HANDLE_SIG (SIGTTIN);
_HANDLE_SIG (SIGTTOU);
_HANDLE_SIG (SIGBUS);
+#ifdef SIGPOLL
_HANDLE_SIG (SIGPOLL);
+#endif
_HANDLE_SIG (SIGPROF);
_HANDLE_SIG (SIGSYS);
_HANDLE_SIG (SIGTRAP);