Skip to content

Commit

Permalink
Fix building on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bugdea1er committed Jan 12, 2025
1 parent c5ee1c7 commit 6b3341c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure CMake
run: cmake -B build -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
run: cmake -B build -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF
- name: Build tests
run: cmake --build build
- name: Run tests
Expand Down
3 changes: 1 addition & 2 deletions src/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ std::pair<fs::path, entry::native_handle_type> create_socket(fs::path path) {
// FIXME: check if the filename isn't too long

sockaddr_un address;
address.sun_len = sizeof(address);
address.sun_family = AF_UNIX;
memcpy(address.sun_path, path.c_str(), path.string().length() + 1);

Expand Down Expand Up @@ -116,7 +115,7 @@ void socket::listen(acceptor function) {
thread.detach();
}

socket::~socket() noexcept = default; // FIXME: shutdown(fd, SHUT_RD)?
socket::~socket() noexcept = default; // FIXME: shutdown(fd, SHUT_RD)?

socket::socket(socket&&) noexcept = default;
socket& socket::operator=(socket&& other) noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion tests/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <gtest/gtest.h>

#include <climits>
#include <sys/socket.h>
#include <sys/un.h>

Expand Down Expand Up @@ -58,7 +59,6 @@ TEST(socket, listening) {
});

sockaddr_un address;
address.sun_len = sizeof(address);
address.sun_family = AF_UNIX;
memcpy(address.sun_path, tmpsocket.path().c_str(),
tmpsocket.path().string().length() + 1);
Expand Down

0 comments on commit 6b3341c

Please sign in to comment.