blob: 13a21e5307083a4ba62977aab671bc388bcc1486 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 887ecc7837962e9be77a4fea7d9122648f73a84a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 15 Aug 2022 14:47:53 -0700
4Subject: [PATCH] mountd: Check for return of stat function
5
6simplify the check, stat() return 0 on success -1 on failure
7
8Fixes clang reported errors e.g.
9
10| v4clients.c:29:6: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
11| if (!stat("/proc/fs/nfsd/clients", &sb) == 0 ||
12| ^ ~~
13
14Upstream-Status: Submitted [https://patchwork.kernel.org/project/linux-nfs/patch/20220816024403.2694169-1-raj.khem@gmail.com/]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16Cc: Konstantin Khorenko <khorenko@virtuozzo.com>
17Cc: Steve Dickson <steved@redhat.com>
18---
19 support/export/v4clients.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/support/export/v4clients.c b/support/export/v4clients.c
23index 5f15b61..3230251 100644
24--- a/support/export/v4clients.c
25+++ b/support/export/v4clients.c
26@@ -26,7 +26,7 @@ void v4clients_init(void)
27 {
28 struct stat sb;
29
30- if (!stat("/proc/fs/nfsd/clients", &sb) == 0 ||
31+ if (stat("/proc/fs/nfsd/clients", &sb) != 0 ||
32 !S_ISDIR(sb.st_mode))
33 return;
34 if (clients_fd >= 0)