From e0e7a74bde52a1aa02d1da758128722598fb6dd8 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 25 Aug 2019 18:52:53 +0200 Subject: Align with legacy_6x. * Normalize include order. * Backport missed bug fixes. * Remove dead code. --- uid.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'uid.c') diff --git a/uid.c b/uid.c index 2db06733..8583a49a 100644 --- a/uid.c +++ b/uid.c @@ -23,10 +23,9 @@ #include "sdump.h" /* - * Machinery for handling UID lists live here. This is mainly to support - * RFC1725/RFC1939-conformant POP3 servers without a LAST command, but may also - * be useful for making the IMAP4 querying logic UID-oriented, if a future - * revision of IMAP forces me to. + * Machinery for handling UID lists live here. This is currently used + * by POP3, but may also be useful for making the IMAP4 querying logic + * UID-oriented. * * These functions are also used by the rest of the code to maintain * string lists. @@ -121,6 +120,7 @@ static int dump_saved_uid(struct uid_db_record *rec, void *unused) return 0; } +/** Read saved IDs from \a idfile and attach to each host in \a hostlist. */ void initialize_saved_lists(struct query *hostlist, const char *idfile) { struct stat statbuf; @@ -347,7 +347,7 @@ static void dump_uid_db(struct uid_db *db) traverse_uid_db(db, dump_uid_db_record, &n_recs); } -/* finish a query */ +/** Finish a successful query */ void uid_swap_lists(struct query *ctl) { /* debugging code */ @@ -390,7 +390,7 @@ void uid_swap_lists(struct query *ctl) report(stdout, GT_("not swapping UID lists, no UIDs seen this query\n")); } -/* finish a query which had errors */ +/** Finish a query which had errors */ void uid_discard_new_list(struct query *ctl) { /* debugging code */ @@ -446,6 +446,7 @@ static int write_uid_db_record(struct uid_db_record *rec, void *arg) return rc < 0 ? -1 : 0; } +/** Write new list of UIDs (state) to \a idfile. */ void write_saved_lists(struct query *hostlist, const char *idfile) { long idcount; @@ -504,7 +505,7 @@ void write_saved_lists(struct query *hostlist, const char *idfile) bailout: (void)fflush(tmpfp); /* return code ignored, we check ferror instead */ errflg |= ferror(tmpfp); - fclose(tmpfp); + errflg |= fclose(tmpfp); /* if we could write successfully, move into place; * otherwise, drop */ if (errflg) { -- cgit v1.2.3