Ver Fonte

Fix st_mtimespec

xcbosa-itx há 2 anos atrás
pai
commit
673eff8d95
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      frp.cpp

+ 3 - 3
frp.cpp

@@ -104,8 +104,8 @@ namespace xc::frp {
         void update() {
         void update() {
             struct stat buf;
             struct stat buf;
             if (stat(this->filePath.c_str(), &buf) == 0) {
             if (stat(this->filePath.c_str(), &buf) == 0) {
-                if (this->mutationTime != buf.st_mtimespec.tv_nsec) {
-                    this->mutationTime = buf.st_mtimespec.tv_nsec;
+                if (this->mutationTime != buf.st_mtime) {
+                    this->mutationTime = buf.st_mtime;
                     this->reloadConfig();
                     this->reloadConfig();
                     return;
                     return;
                 }
                 }
@@ -160,7 +160,7 @@ namespace xc::frp {
         void doStart() {
         void doStart() {
             struct stat buf;
             struct stat buf;
             if (stat(this->filePath.c_str(), &buf) == 0) {
             if (stat(this->filePath.c_str(), &buf) == 0) {
-                this->mutationTime = buf.st_mtimespec.tv_nsec;
+                this->mutationTime = buf.st_mtime;
             }
             }
             ostringstream oss;
             ostringstream oss;
             oss << "frpc -c " << this->filePath << " &";
             oss << "frpc -c " << this->filePath << " &";