nwrap_lines_unload(nwrap);
}
-static void nwrap_files_cache_reload(struct nwrap_cache *nwrap)
+static bool nwrap_files_cache_reload(struct nwrap_cache *nwrap)
{
struct stat st;
int ret;
"Unable to open '%s' readonly %d:%s",
nwrap->path, nwrap->fd,
strerror(errno));
- return;
+ return false;
}
nwrap->fd = fileno(nwrap->fp);
fclose(nwrap->fp);
nwrap->fp = NULL;
nwrap->fd = -1;
- return;
+ return false;
}
if (retried == false && st.st_nlink == 0) {
NWRAP_LOG(NWRAP_LOG_TRACE,
"st_mtime[%u] hasn't changed, skip reload",
(unsigned)st.st_mtime);
- return;
+ return true;
}
NWRAP_LOG(NWRAP_LOG_TRACE,
if (!ok) {
NWRAP_LOG(NWRAP_LOG_ERROR, "Failed to reload %s", nwrap->path);
nwrap_files_cache_unload(nwrap);
+ return false;
}
NWRAP_LOG(NWRAP_LOG_TRACE, "Reloaded %s", nwrap->path);
+ return true;
}
/*