git: a479301abb2c - main - tests/sys/capsicum: Fix -Wshadow issue with `fd_set`

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Tue, 10 Nov 2026 05:21:09 UTC
The branch main has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=a479301abb2c7b384f574fcc641e502f70654835

commit a479301abb2c7b384f574fcc641e502f70654835
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-11-10 05:17:26 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-11-10 05:17:26 +0000

    tests/sys/capsicum: Fix -Wshadow issue with `fd_set`
    
    `fd_set` is defined in `sys/select.h`, and prior to this change, was in fcntl.cc as well.
    
    This change renames `fd_set` to `fd_set_` to avoid the name collision.
    
    MFC after:      1 week
    Reported by:    gcc 14
    Fixes:          04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
---
 tests/sys/capsicum/fcntl.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/sys/capsicum/fcntl.cc b/tests/sys/capsicum/fcntl.cc
index 1ae33c2e051e..a9349b153cdc 100644
--- a/tests/sys/capsicum/fcntl.cc
+++ b/tests/sys/capsicum/fcntl.cc
@@ -332,17 +332,17 @@ TEST(Fcntl, FLSubRights) {
 
   // Check operations that need CAP_FCNTL with specific subrights.
   int fd_get = dup(fd);
-  int fd_set = dup(fd);
+  int fd_set_ = dup(fd);
   EXPECT_OK(cap_fcntls_limit(fd_get, CAP_FCNTL_GETFL));
-  EXPECT_OK(cap_fcntls_limit(fd_set, CAP_FCNTL_SETFL));
+  EXPECT_OK(cap_fcntls_limit(fd_set_, CAP_FCNTL_SETFL));
 
   fd_flag = fcntl(fd_get, F_GETFL, 0);
   EXPECT_OK(fd_flag);
-  EXPECT_NOTCAPABLE(fcntl(fd_set, F_GETFL, 0));
-  EXPECT_OK(fcntl(fd_set, F_SETFL, fd_flag));
+  EXPECT_NOTCAPABLE(fcntl(fd_set_, F_GETFL, 0));
+  EXPECT_OK(fcntl(fd_set_, F_SETFL, fd_flag));
   EXPECT_NOTCAPABLE(fcntl(fd_get, F_SETFL, fd_flag));
   close(fd_get);
-  close(fd_set);
+  close(fd_set_);
 
   // Check operations that need CAP_FCNTL with no subrights => ENOTCAPABLE.
   EXPECT_OK(cap_fcntls_limit(fd, 0));