sgw: cache the correct timestamp
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 15 Oct 2015 09:58:44 +0000 (11:58 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 15 Oct 2015 12:47:57 +0000 (14:47 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/egressFile.c

index 4073983..d7f83ef 100644 (file)
@@ -512,6 +512,7 @@ static bool readEgressFile(const char * fileName) {
 #else
     mtim = &statBuf.st_mtime;
 #endif
+
     if (!memcmp(&cachedStat.timeStamp, mtim, sizeof(cachedStat.timeStamp))) {
       /* file did not change since last read */
       return false;
@@ -526,7 +527,7 @@ static bool readEgressFile(const char * fileName) {
     goto outerror;
   }
 
-  memcpy(&cachedStat.timeStamp, &statBuf.st_mtime, sizeof(cachedStat.timeStamp));
+  memcpy(&cachedStat.timeStamp, mtim, sizeof(cachedStat.timeStamp));
 
   /* copy 'current' egress interfaces into 'previous' field */
   readEgressFileClear();