mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
chore: fix warnings when building on macOS
This commit is contained in:
parent
e0cf9df9e7
commit
43ec38d65d
@ -144,6 +144,7 @@ ssize_t portable_getxattr(const char* path, const char* name, void* value,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
pid_t get_dwarfs_pid(fs::path const& path) {
|
pid_t get_dwarfs_pid(fs::path const& path) {
|
||||||
std::array<char, 32> attr_buf;
|
std::array<char, 32> attr_buf;
|
||||||
auto attr_len = portable_getxattr(path.c_str(), "user.dwarfs.driver.pid",
|
auto attr_len = portable_getxattr(path.c_str(), "user.dwarfs.driver.pid",
|
||||||
@ -154,6 +155,7 @@ pid_t get_dwarfs_pid(fs::path const& path) {
|
|||||||
return folly::to<pid_t>(std::string_view(attr_buf.data(), attr_len));
|
return folly::to<pid_t>(std::string_view(attr_buf.data(), attr_len));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
bool wait_until_file_ready(fs::path const& path,
|
bool wait_until_file_ready(fs::path const& path,
|
||||||
std::chrono::milliseconds timeout) {
|
std::chrono::milliseconds timeout) {
|
||||||
@ -354,7 +356,11 @@ void ignore_sigpipe() {
|
|||||||
std::memset(&sa, 0, sizeof(sa));
|
std::memset(&sa, 0, sizeof(sa));
|
||||||
sa.sa_handler = SIG_IGN;
|
sa.sa_handler = SIG_IGN;
|
||||||
int res = ::sigaction(SIGPIPE, &sa, NULL);
|
int res = ::sigaction(SIGPIPE, &sa, NULL);
|
||||||
assert(res == 0);
|
if (res != 0) {
|
||||||
|
std::cerr << "sigaction(SIGPIPE, SIG_IGN): " << std::strerror(errno)
|
||||||
|
<< "\n";
|
||||||
|
std::abort();
|
||||||
|
}
|
||||||
already_ignoring = true;
|
already_ignoring = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -585,7 +591,7 @@ class driver_runner {
|
|||||||
bool unmount() {
|
bool unmount() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static constexpr int const kSigIntExitCode{-1073741510};
|
static constexpr int const kSigIntExitCode{-1073741510};
|
||||||
#else
|
#elif !defined(__APPLE__)
|
||||||
static constexpr int const kSigIntExitCode{SIGINT};
|
static constexpr int const kSigIntExitCode{SIGINT};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user