Skip to content

Commit

Permalink
fixup! kiwix-serve reloads the library automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan committed Dec 5, 2021
1 parent 892fae6 commit 8897c71
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/server/kiwix-serve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#else
# include <unistd.h>
# include <signal.h>
# include <sys/stat.h>
#endif
#include <sys/stat.h>

#ifdef __APPLE__
# import <sys/sysctl.h>
Expand Down Expand Up @@ -128,15 +128,17 @@ void setup_sighandlers()

uint64_t fileModificationTime(const std::string& path)
{
#ifndef _WIN32
#if defined(_WIN32)
#define stat _stat
#endif
struct stat fileStatData;
if ( stat(path.c_str(), &fileStatData) == 0 ) {
return fileStatData.st_mtim.tv_sec;
return fileStatData.st_mtime;
}
#else
// XXX: do we need library reloading under Windows?
#endif
return 0;
#ifdef _WIN32
#undef stat
#endif
}

uint64_t newestFileTimestamp(const std::vector<std::string>& paths)
Expand Down

0 comments on commit 8897c71

Please sign in to comment.