Re: [mlmmj] Re: bug: Index is never incremented
Baptiste Daroussin <[email protected]> Sat, 9 Dec 2023 20:23:11 +0100
| Newsgroups | org.mlmmj.mlmmj |
|---|---|
| Message-ID | <6xirowbbyhawpytmq5e3vv33bxsy7orhpyfysunyhanpasxivi@2aesfxdlzlyh> |
On Sat, Dec 09, 2023 at 11:59:52AM -0500, Konstantin Ryabitsev wrote:
> On Sat, Dec 09, 2023 at 11:26:39AM -0500, Konstantin Ryabitsev wrote:
> > Hello:
> >
> > I just realized that I have a problem with the lists that are set up to use
> > 1.4.0 -- the index is never incremented.
>
> Looks like in src/incindexfile.c where we're trying to write to a file that is
> open as readonly. The following patch fixes the immediate problem, but you
> probably want a test to go with it.
>
> diff --git a/src/incindexfile.c b/src/incindexfile.c
> index ce85fa2..33fc50e 100644
> --- a/src/incindexfile.c
> +++ b/src/incindexfile.c
> @@ -51,7 +51,7 @@ int incindexfile(int listfd)
> return 0;
> }
>
> - fp = fdopen(fd, "r");
> + fp = fdopen(fd, "r+");
> if (fp == NULL) {
> log_error(LOG_ARGS, "Error fdopening index file");
> close(fd);
>
>
> -K
>
>
Thank you for the fix, I wonder why the index was not broken for my freebsd
mailing list using it, it actually is, simply I tested on mailing list without
archives (bummer) meaning the index does not matter much :(
The testsuite was also too naive.
1.4.1 is now out fixing the issue, and the testsuite extended to be less naive
Sorry about that ridiculous bug :(
Bapt