aboutsummaryrefslogtreecommitdiff
path: root/src/nix-daemon/nix-daemon.cc
diff options
context:
space:
mode:
authorManuel Jacob <me@manueljacob.de>2015-10-04 13:53:23 +0200
committerManuel Jacob <me@manueljacob.de>2015-10-06 22:28:30 +0200
commit7888b2ba15528a7caa24f6923203a55cc38087ed (patch)
tree5a2525da8c2d43c113e2f83c6486159cb8eaa472 /src/nix-daemon/nix-daemon.cc
parent12c1776df9c1e658c614cfd5b2cf398dc7202689 (diff)
Define SOL_LOCAL if not defined already (e.g. on FreeBSD).
Some evidence that defining it to be 0 is right: * OS X headers define it to be 0. * Other code uses 0 instead of SOL_LOCAL to check for peer credentials (e.g. FreeBSD's implementation of getpeereid).
Diffstat (limited to 'src/nix-daemon/nix-daemon.cc')
-rw-r--r--src/nix-daemon/nix-daemon.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc
index aaae691e9..1d0ff701f 100644
--- a/src/nix-daemon/nix-daemon.cc
+++ b/src/nix-daemon/nix-daemon.cc
@@ -692,6 +692,10 @@ static PeerInfo getPeerInfo(int remote)
#elif defined(LOCAL_PEERCRED)
+#if !defined(SOL_LOCAL)
+#define SOL_LOCAL 0
+#endif
+
xucred cred;
socklen_t credLen = sizeof(cred);
if (getsockopt(remote, SOL_LOCAL, LOCAL_PEERCRED, &cred, &credLen) == -1)