Skip to content

Commit cc1cf82

Browse files
committed
Lint
1 parent 6455a6d commit cc1cf82

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

appsec/src/helper/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ bool ensure_unique_abstract_socket(std::string_view socket_path)
9898

9999
// Try to connect to the socket. If successful, another helper is running
100100
// NOLINTNEXTLINE(android-cloexec-socket)
101-
int sock = ::socket(AF_UNIX, SOCK_STREAM, 0);
101+
int const sock = ::socket(AF_UNIX, SOCK_STREAM, 0);
102102
if (sock == -1) {
103103
SPDLOG_INFO("Failed to create test socket: errno {}", errno);
104104
return false;
@@ -114,7 +114,7 @@ bool ensure_unique_abstract_socket(std::string_view socket_path)
114114
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-constant-array-index)
115115
addr.sun_path[size + 1] = '\0';
116116

117-
int res = ::connect(
117+
int const res = ::connect(
118118
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
119119
sock, reinterpret_cast<struct sockaddr *>(&addr), sizeof(addr));
120120
::close(sock);

appsec/src/helper/network/acceptor.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ acceptor::acceptor(const std::string_view &sv)
3131
struct sockaddr_un addr {};
3232
std::size_t addr_size;
3333
addr.sun_family = AF_UNIX;
34-
bool is_abstract = (!sv.empty() && sv[0] == '@');
34+
bool const is_abstract = (!sv.empty() && sv[0] == '@');
3535

3636
if (is_abstract) {
3737
#ifdef __linux__
@@ -57,18 +57,17 @@ acceptor::acceptor(const std::string_view &sv)
5757
addr_size = sizeof(addr);
5858

5959
// Remove the existing socket
60-
int res = ::unlink(static_cast<char *>(addr.sun_path));
60+
int const res = ::unlink(static_cast<char *>(addr.sun_path));
6161
if (res == -1 && errno != ENOENT) {
6262
SPDLOG_ERROR("Failed to unlink {}: errno {}", addr.sun_path, errno);
6363
throw std::system_error(errno, std::generic_category());
6464
}
6565
SPDLOG_DEBUG("Unlinked {}", addr.sun_path);
6666
}
6767

68-
int res =
68+
int res = ::bind(
6969
// NOLINTNEXTLINE
70-
::bind(
71-
sock_.get(), reinterpret_cast<struct sockaddr *>(&addr), addr_size);
70+
sock_.get(), reinterpret_cast<struct sockaddr *>(&addr), addr_size);
7271
if (res == -1) {
7372
if (is_abstract) {
7473
SPDLOG_ERROR("Failed to bind abstract socket: errno {}", errno);

0 commit comments

Comments
 (0)