Hello,
I had to apply the attached patch to build on OS X.
The error before applying the patch is:
/usr/include/unistd.h:691:6: error: conflicting types for
'getpeereid'
int getpeereid(int, uid_t *, gid_t *);
^
In file included from ipc_eid.c:3:0:
getpeereid.h:6:12: note: previous declaration of 'getpeereid' was
here
extern int getpeereid (int, int *, int *) ;
^
The patch also changes the types of args to getpeereid from int to
unsigned int. Without that part, I get the warning (it still compiles):
ipc_eid.c: In function 'ipc_eid':
ipc_eid.c:9:3: warning: pointer targets in passing argument 2 of
'getpeereid' differ in signedness [-Wpointer-sign]
if (getpeereid(s, &dummyu, &dummyg) < 0) return -1 ;
^
In file included from djbunix.h:6:0,
from webipc.h:16,
from ipc_eid.c:4:
/usr/include/unistd.h:691:6: note: expected 'uid_t *' but argument
is of type 'int *'
int getpeereid(int, uid_t *, gid_t *);
^
For what it's worth, new releases of both execline and s6 seemed to
build OK.
--
Patrick Mahoney--- a/src/libstddjb/getpeereid.h
+++ b/src/libstddjb/getpeereid.h
@@ -3,6 +3,14 @@
#ifndef GETPEEREID_H
#define GETPEEREID_H
+#include "sysdeps.h"
+
+#ifdef HASGETPEEREID
+/* syscall exists - do nothing */
+
+#else
+
extern int getpeereid (int, int *, int *) ;
#endif
+#endif
diff --git a/src/libstddjb/ipc_eid.c b/src/libstddjb/ipc_eid.c
index 21322f6..330c0b8 100644
--- a/src/libstddjb/ipc_eid.c
+++ b/src/libstddjb/ipc_eid.c
@@ -5,7 +5,7 @@
int ipc_eid (int s, unsigned int *u, unsigned int *g)
{
- int dummyu, dummyg ;
+ unsigned int dummyu, dummyg ;
if (getpeereid(s, &dummyu, &dummyg) < 0) return -1 ;
*u = (unsigned int)dummyu ;
*g = (unsigned int)dummyg ;