From 10481d25861f1c25b53cfbd8119199ef2e918f9f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 May 2020 00:48:30 +0100 Subject: chore(3p/nix): Remove some OS X specific defines This project will be dropping OS X support until the core is simplified. --- third_party/nix/src/libutil/util.cc | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'third_party/nix/src/libutil') diff --git a/third_party/nix/src/libutil/util.cc b/third_party/nix/src/libutil/util.cc index b77fb8ac0ab4..6076bdc3934b 100644 --- a/third_party/nix/src/libutil/util.cc +++ b/third_party/nix/src/libutil/util.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -27,14 +28,6 @@ #include "serialise.hh" #include "sync.hh" -#ifdef __APPLE__ -#include -#endif - -#ifdef __linux__ -#include -#endif - namespace nix { const std::string nativeSystem = SYSTEM; @@ -819,12 +812,6 @@ int Pid::kill() { process group, send the signal to every process in the child process group (which hopefully includes *all* its children). */ if (::kill(separatePG ? -pid : pid, killSignal) != 0) { - /* On BSDs, killing a process group will return EPERM if all - processes in the group are zombies (or something like - that). So try to detect and ignore that situation. */ -#if __FreeBSD__ || __APPLE__ - if (errno != EPERM || ::kill(pid, 0) != 0) -#endif LOG(ERROR) << SysError("killing process %d", pid).msg(); } @@ -876,20 +863,9 @@ void killUser(uid_t uid) { } while (true) { -#ifdef __APPLE__ - /* OSX's kill syscall takes a third parameter that, among - other things, determines if kill(-1, signo) affects the - calling process. In the OSX libc, it's set to true, - which means "follow POSIX", which we don't want here - */ - if (syscall(SYS_kill, -1, SIGKILL, false) == 0) { - break; - } -#else if (kill(-1, SIGKILL) == 0) { break; } -#endif if (errno == ESRCH) { break; } /* no more processes */ -- cgit 1.4.1