]> git.meshlink.io Git - meshlink/blobdiff - src/conf.c
Avoid unnecessary calls to time().
[meshlink] / src / conf.c
index a9e3e4d6f0d2171fb893fe87515df8d78ab4a391..e0d3595041c2807d7393e912ff935b8584f0751c 100644 (file)
@@ -735,7 +735,7 @@ bool invitation_read(meshlink_handle_t *mesh, const char *conf_subdir, const cha
                return false;
        }
 
-       if(time(NULL) > st.st_mtime + mesh->invitation_timeout) {
+       if(mesh->loop.now.tv_sec > st.st_mtime + mesh->invitation_timeout) {
                logger(mesh, MESHLINK_ERROR, "Peer tried to use an outdated invitation file %s\n", name);
                fclose(f);
                unlink(used_path);