diff --git a/src/yp.c b/src/yp.c index 4470d47b80c0bf5648d151c31ab0048f7b24e8c8..0aa101147f4dee36cf113b05f9975c1414d6a3cf 100644 --- a/src/yp.c +++ b/src/yp.c @@ -944,12 +944,9 @@ void yp_remove (const char *mount) void yp_touch (const char *mount) { struct yp_server *server = (struct yp_server *)active_yps; - time_t trigger; ypdata_t *search_list = NULL; thread_rwlock_rlock (&yp_lock); - /* do update in 3 secs, give stats chance to update */ - trigger = time(NULL) + 3; if (server) search_list = server->mounts; @@ -964,9 +961,9 @@ void yp_touch (const char *mount) search_list = yp->next; continue; } - /* only force if touch */ - if (yp->process == do_yp_touch) - yp->next_update = trigger; + /* don't update the directory if there is a touch scheduled soon */ + if (yp->process == do_yp_touch && now + yp->touch_interval - yp->next_update > 60) + yp->next_update = now + 3; } server = server->next; if (server)