On Fri, 31 Aug 2007, John Capo wrote:

Another thing, the fsync()/fclose() calls in this loop in
sync_message_fsync() should be reversed, at least on on BSD systems.

   /* fsync() files in reverse order: ReiserFS FAQ indicates that this
    * gives best potential for optimisation */
   for (i = (l->file_count-1) ; i >= 0 ; i--) {
       fsync(fileno(l->file[i]));
       fclose(l->file[i]);
       l->file[i] = NULL;
   }

My current tree has:

    /* fsync() files in reverse order: ReiserFS FAQ indicates that this
     * gives best potential for optimisation */
    for (i = (l->file_count-1) ; i >= 0 ; i--) {
        if ((fflush(l->file[i]) != 0) ||
            (fsync(fileno(l->file[i])) < 0) ||
            (fclose(l->file[i]) != 0))
            r = IMAP_IOERROR;  /* Aggregate to single error */

        l->file[i] = NULL;
    }
    l->file_count = 0;

Looks like it been that way since July 2005. Hope this wasn't a bug
fix that I failed to merge upstream.

--
David Carter                             Email: [EMAIL PROTECTED]
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.

Reply via email to