From 699f64035ae9fca24db6b14f2e65ed5dcce65688 Mon Sep 17 00:00:00 2001 From: oes Date: Thu, 8 May 2003 15:19:15 +0000 Subject: [PATCH] sweep: Made loop structure of sweep step mirror that of mark step --- loaders.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/loaders.c b/loaders.c index 02deadfd..35a910ec 100644 --- a/loaders.c +++ b/loaders.c @@ -1,4 +1,4 @@ -const char loaders_rcs[] = "$Id: loaders.c,v 1.50.2.3 2002/11/20 17:12:30 oes Exp $"; +const char loaders_rcs[] = "$Id: loaders.c,v 1.50.2.4 2003/05/06 15:57:12 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/Attic/loaders.c,v $ @@ -35,6 +35,10 @@ const char loaders_rcs[] = "$Id: loaders.c,v 1.50.2.3 2002/11/20 17:12:30 oes Ex * * Revisions : * $Log: loaders.c,v $ + * Revision 1.50.2.4 2003/05/06 15:57:12 oes + * Bugfix: Update last_active pointer in sweep() before + * leaving an active client. Closes bugs #724395, #727882 + * * Revision 1.50.2.3 2002/11/20 17:12:30 oes * Ooops, forgot one change. * @@ -442,17 +446,26 @@ void sweep(void) } } - for (fl = files; fl && ((nfl = fl->next) != NULL) ; fl = fl->next) + nfl = files; + fl = files->next; + + while (fl != NULL) { - if ( ( 0 == nfl->active ) && ( NULL != nfl->unloader ) ) + if ( ( 0 == fl->active ) && ( NULL != fl->unloader ) ) { - fl->next = nfl->next; + nfl->next = fl->next; - (nfl->unloader)(nfl->f); + (fl->unloader)(fl->f); - freez(nfl->filename); + freez(fl->filename); + freez(fl); - freez(nfl); + fl = nfl->next; + } + else + { + nfl = fl; + fl = fl->next; } } @@ -514,6 +527,7 @@ int check_file_changed(const struct file_list * current, return 1; } + fs->filename = strdup(filename); fs->lastmodified = statbuf->st_mtime; -- 2.49.0