diff options
author | Darren Tucker <dtucker@zip.com.au> | 2015-11-30 07:23:53 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2015-11-30 07:23:53 +1100 |
commit | 3ddd15e1b63a4d4f06c8ab16fbdd8a5a61764f16 (patch) | |
tree | 4fbce3d8671872f8e1cd91230a73af14e288a28f | |
parent | b1d6b3971ef256a08692efc409fc9ada719111cc (diff) |
Add a null implementation of pledge.
Fixes builds on almost everything.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 8 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 1527a13dc..85e984375 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -854,7 +854,6 @@ mips-sony-bsd|mips-sony-newsos4) | |||
854 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], | 854 | AC_DEFINE([SYSLOG_R_SAFE_IN_SIGHAND], [1], |
855 | [syslog_r function is safe to use in in a signal handler]) | 855 | [syslog_r function is safe to use in in a signal handler]) |
856 | TEST_MALLOC_OPTIONS="AFGJPRX" | 856 | TEST_MALLOC_OPTIONS="AFGJPRX" |
857 | AC_CHECK_FUNCS([pledge]) | ||
858 | ;; | 857 | ;; |
859 | *-*-solaris*) | 858 | *-*-solaris*) |
860 | if test "x$withval" != "xno" ; then | 859 | if test "x$withval" != "xno" ; then |
@@ -1669,6 +1668,7 @@ AC_CHECK_FUNCS([ \ | |||
1669 | nsleep \ | 1668 | nsleep \ |
1670 | ogetaddrinfo \ | 1669 | ogetaddrinfo \ |
1671 | openlog_r \ | 1670 | openlog_r \ |
1671 | pledge \ | ||
1672 | poll \ | 1672 | poll \ |
1673 | prctl \ | 1673 | prctl \ |
1674 | pstat \ | 1674 | pstat \ |
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index f7be415ec..2a788e47f 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -276,3 +276,11 @@ getpgid(pid_t pid) | |||
276 | return -1; | 276 | return -1; |
277 | } | 277 | } |
278 | #endif | 278 | #endif |
279 | |||
280 | #ifndef HAVE_PLEDGE | ||
281 | int | ||
282 | pledge(const char *promises, const char *paths[]) | ||
283 | { | ||
284 | return 0; | ||
285 | } | ||
286 | #endif | ||
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index ff347a24b..0d81d1735 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -122,4 +122,8 @@ pid_t getpgid(pid_t); | |||
122 | # define krb5_free_error_message(a,b) do { } while(0) | 122 | # define krb5_free_error_message(a,b) do { } while(0) |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | #ifndef HAVE_PLEDGE | ||
126 | int pledge(const char *promises, const char *paths[]); | ||
127 | #endif | ||
128 | |||
125 | #endif /* _BSD_MISC_H */ | 129 | #endif /* _BSD_MISC_H */ |