summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-01-13 21:42:12 +0000
committerKinsey Moore <kmoore@digium.com>2012-01-13 21:42:12 +0000
commit76888b59903e8a83bdbc68bc809b7ade43fe817e (patch)
tree1808350cfc381ae911cc886547a06fd1308efab9 /main
parent9c161503dca5eb7944244ba96c05270794994677 (diff)
Make sure asterisk builds on OpenBSD
OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not 'struct ucred', which causes compilation of main/asterisk.c to fail in read_credentials(). This allows configure to check for sockpeercred and asterisk to deal with it properly. (closes issue ASTERISK-18929) Reported-by: Barry Miller Patch-by: Barry Miller ........ Merged revisions 350730 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 350731 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 9473fc986..12dc6483e 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1200,7 +1200,12 @@ static pthread_t lthread;
static int read_credentials(int fd, char *buffer, size_t size, struct console *con)
{
#if defined(SO_PEERCRED)
+#ifdef HAVE_STRUCT_SOCKPEERCRED_UID
+#define HAVE_STRUCT_UCRED_UID
+ struct sockpeercred cred;
+#else
struct ucred cred;
+#endif
socklen_t len = sizeof(cred);
#endif
#if defined(HAVE_GETPEEREID)