From 689ef502f5b0655c9923ed77da2ae3504630f473 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 22:27:37 +0100 Subject: refactor(3p/nix): Apply clang-tidy's readability-* fixes This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html --- third_party/nix/src/libmain/stack.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libmain/stack.cc') diff --git a/third_party/nix/src/libmain/stack.cc b/third_party/nix/src/libmain/stack.cc index 87018b975c29..f100b39156e4 100644 --- a/third_party/nix/src/libmain/stack.cc +++ b/third_party/nix/src/libmain/stack.cc @@ -40,7 +40,7 @@ static void sigsegvHandler(int signo, siginfo_t* info, void* ctx) { sigfillset(&act.sa_mask); act.sa_handler = SIG_DFL; act.sa_flags = 0; - if (sigaction(SIGSEGV, &act, nullptr)) { + if (sigaction(SIGSEGV, &act, nullptr) != 0) { abort(); } } @@ -54,7 +54,7 @@ void detectStackOverflow() { stack.ss_size = 4096 * 4 + MINSIGSTKSZ; static auto stackBuf = std::make_unique>(stack.ss_size); stack.ss_sp = stackBuf->data(); - if (!stack.ss_sp) { + if (stack.ss_sp == nullptr) { throw Error("cannot allocate alternative stack"); } stack.ss_flags = 0; @@ -66,7 +66,7 @@ void detectStackOverflow() { sigfillset(&act.sa_mask); act.sa_sigaction = sigsegvHandler; act.sa_flags = SA_SIGINFO | SA_ONSTACK; - if (sigaction(SIGSEGV, &act, nullptr)) { + if (sigaction(SIGSEGV, &act, nullptr) != 0) { throw SysError("resetting SIGSEGV"); } #endif -- cgit 1.4.1