Skip to content

Commit

Permalink
Don't use sig_atomic_t on Windows.
Browse files Browse the repository at this point in the history
We don't setup signal handler on Windows, so we can replace
`volatil sig_atomic_t` by simple `bool`.
  • Loading branch information
mgautierfr committed Aug 30, 2024
1 parent 6ea97c3 commit 7a46a89
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/kiwix-serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ inline std::string normalizeRootUrl(std::string rootUrl)
return rootUrl.empty() ? rootUrl : "/" + rootUrl;
}

#ifndef _WIN32
volatile sig_atomic_t waiting = false;
volatile sig_atomic_t libraryMustBeReloaded = false;

#ifndef _WIN32
void handle_sigterm(int signum)
{
if ( waiting == false ) {
Expand Down Expand Up @@ -144,6 +143,9 @@ void setup_sighandlers()
set_signal_handler(SIGINT, &handle_sigterm);
set_signal_handler(SIGHUP, &handle_sighup);
}
#else
bool waiting = false;
bool libraryMustBeReloaded = false;
#endif

uint64_t fileModificationTime(const std::string& path)
Expand Down

0 comments on commit 7a46a89

Please sign in to comment.