diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-23T23·48+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-24T01·13+0100 |
commit | 10481d25861f1c25b53cfbd8119199ef2e918f9f (patch) | |
tree | e89d668351fa12faa7b1508c2a7a68582d48bf22 /third_party/nix/src/libutil | |
parent | bac38f3c49db6d9a85ba447d164d35811dfdc8f9 (diff) |
chore(3p/nix): Remove some OS X specific defines r/834
This project will be dropping OS X support until the core is simplified.
Diffstat (limited to 'third_party/nix/src/libutil')
-rw-r--r-- | third_party/nix/src/libutil/util.cc | 26 |
1 files changed, 1 insertions, 25 deletions
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 <grp.h> #include <pwd.h> #include <sys/ioctl.h> +#include <sys/prctl.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> @@ -27,14 +28,6 @@ #include "serialise.hh" #include "sync.hh" -#ifdef __APPLE__ -#include <sys/syscall.h> -#endif - -#ifdef __linux__ -#include <sys/prctl.h> -#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 */ |