[cvs] bogofilter/src datastore_db.c,1.185,1.186

Matthias Andree matthias.andree at gmx.de
Wed Mar 9 03:33:47 CET 2005


David Relson <relson at users.sourceforge.net> writes:

> Update of /cvsroot/bogofilter/bogofilter/src
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv365
>
> Modified Files:
> 	datastore_db.c 
> Log Message:
> Correct file/directory argument mismatch.

You corrected non-TXN but broke TXN.

For TXN, dsm_recover_open opens an environment, hence directory is
desired and locked. (Recovering one environment can fix multiple
databases BTW.)

For traditional, dsm_recover_open has no environment so it must lock the
database file.

For TXN, pass the file name and see it die when it cannot lock
/home/someone/.bogofilter/wordlist.db/lockfile-d.

I can see three alternatives to fix this, two quite similar:

1a. provide either information also through the dsm_recover_open
    interface and let the actual implementation pick which one it needs

1b. the dbx_recover_open would need to strip the file name off the path
    by itself, goes without I/F change but computes the dirname twice

2. let the traditional code use a directory-locking scheme. May be
   undesirable.

I'm not doing it to not interfere with your changes (bed's calling anyhow)

> Index: datastore_db.c
> ===================================================================
> RCS file: /cvsroot/bogofilter/bogofilter/src/datastore_db.c,v
> retrieving revision 1.185
> retrieving revision 1.186
> diff -u -d -r1.185 -r1.186
> --- datastore_db.c	9 Mar 2005 00:42:15 -0000	1.185
> +++ datastore_db.c	9 Mar 2005 01:26:57 -0000	1.186
> @@ -940,7 +940,7 @@
>  
>      dsm_init(directory, db_file);
>  
> -    dbe = dsm->dsm_recover_open(directory);
> +    dbe = dsm->dsm_recover_open(db_file);
>      if (dbe == NULL) {
>  	exit(EX_ERROR);
>      }

-- 
Matthias Andree
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list