Fix macOS build

https://hydra.nixos.org/build/107457009
This commit is contained in:
Eelco Dolstra 2019-11-26 21:08:56 +01:00
parent 313106d549
commit abb8ef619b
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE

View File

@ -155,7 +155,7 @@ void initNix()
sshd). This breaks build users because they don't have access
to the TMPDIR, in particular in nix-store --serve. */
#if __APPLE__
if (getuid() == 0 && hasPrefix(getEnv("TMPDIR"), "/var/folders/"))
if (getuid() == 0 && hasPrefix(getEnv("TMPDIR").value_or("/tmp"), "/var/folders/"))
unsetenv("TMPDIR");
#endif
}