]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build on Ubuntu 21 (#855)
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 8 Jul 2021 03:25:48 +0000 (03:25 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 8 Jul 2021 14:39:17 +0000 (14:39 +0000)
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 <heinrich.schuchardt@canonical.com>
src/tools.cc

index b0fb52ff676666c58fb3073fe58740bc64ed1a9c..00d77cc4c1ac8bba2b99b0cd33a1332af0473a36 100644 (file)
@@ -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 */