diff options
Diffstat (limited to 'meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch')
-rw-r--r-- | meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch b/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch index 8ea55d0e16..f267875ed8 100644 --- a/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch +++ b/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From faaa796a138cbd5033b1e53f33faac0cf4162bf5 Mon Sep 17 00:00:00 2001 | 1 | From 86dae8010310d13bd2a2beb006b4085d06ae1556 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sun, 25 Jun 2017 00:59:24 -0700 | 3 | Date: Sun, 25 Jun 2017 00:59:24 -0700 |
4 | Subject: [PATCH] tools.cc: fixed unused-result warning | 4 | Subject: [PATCH] tools.cc: fixed unused-result warning |
@@ -12,21 +12,23 @@ fix | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
13 | 13 | ||
14 | --- | 14 | --- |
15 | src/tools.cc | 4 ++-- | 15 | src/tools.cc | 5 +++-- |
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | 16 | 1 file changed, 3 insertions(+), 2 deletions(-) |
17 | 17 | ||
18 | diff --git a/src/tools.cc b/src/tools.cc | 18 | diff --git a/src/tools.cc b/src/tools.cc |
19 | index 8137a03..843e266 100644 | 19 | index 5829574..19f0836 100644 |
20 | --- a/src/tools.cc | 20 | --- a/src/tools.cc |
21 | +++ b/src/tools.cc | 21 | +++ b/src/tools.cc |
22 | @@ -612,8 +612,8 @@ enter_suid(void) | 22 | @@ -581,8 +581,10 @@ enter_suid(void) |
23 | if (setresuid((uid_t)-1, 0, (uid_t)-1) < 0) | 23 | debugs (21, 3, "enter_suid: setresuid failed: " << xstrerr(xerrno)); |
24 | debugs (21, 3, "enter_suid: setresuid failed: " << xstrerror ()); | 24 | } |
25 | #else | 25 | #else |
26 | - | 26 | - |
27 | - setuid(0); | 27 | - setuid(0); |
28 | + if (setuid(0) < 0) | 28 | + if (setuid(0) < 0) { |
29 | + debugs(50, DBG_IMPORTANT, "WARNING: no_suid: setuid(0): " << xstrerror()); | 29 | + const auto xerrno = errno; |
30 | + debugs(50, DBG_IMPORTANT, "WARNING: no_suid: setuid(0): " << xstrerr(xerrno)); | ||
31 | + } | ||
30 | #endif | 32 | #endif |
31 | #if HAVE_PRCTL && defined(PR_SET_DUMPABLE) | 33 | #if HAVE_PRCTL && defined(PR_SET_DUMPABLE) |
32 | /* Set Linux DUMPABLE flag */ | 34 | /* Set Linux DUMPABLE flag */ |