From: Heinrich Schuchardt Date: Thu, 8 Jul 2021 03:25:48 +0000 (+0000) Subject: Fix build on Ubuntu 21 (#855) X-Git-Tag: SQUID_6_0_1~316 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=300437197350ee4eb6d5f75b3cb8c35a7b9f29ed;p=thirdparty%2Fsquid.git Fix build on Ubuntu 21 (#855) The `-Wunused-result` warning for setuid(0) call was observed on Ubuntu 21.04 (when cross compiling Squid for Ubuntu 21.10). Signed-off-by: Heinrich Schuchardt --- diff --git a/src/tools.cc b/src/tools.cc index b0fb52ff67..00d77cc4c1 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -582,7 +582,10 @@ enter_suid(void) } #else - setuid(0); + if (setuid(0) < 0) { + const auto xerrno = errno; + debugs(21, 3, "setuid(0) failed: " << xstrerr(xerrno)); + } #endif #if HAVE_PRCTL && defined(PR_SET_DUMPABLE) /* Set Linux DUMPABLE flag */