From: Timo Sirainen Date: Mon, 25 Nov 2019 11:20:53 +0000 (+0200) Subject: lib-fs: Remove fs_set_critical() X-Git-Tag: 2.3.10~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a8e5f9a35458d72ed8f5b0dc37488c6a83437c3;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Remove fs_set_critical() The original idea was similar to mail_storage_set_error/critical() separation. But in storage they are used to clearly separate between errors caused by untrusted users vs internal errors. In lib-fs case all the errors are internal errors. Also all the lib-fs callers are supposed to log the errors unless they decide to handle them specially, so there's really no need a fs_set_critical() that just causes them to be logged twice. --- diff --git a/src/lib-fs/fs-api-private.h b/src/lib-fs/fs-api-private.h index 6f599a3fa6..ae36713d73 100644 --- a/src/lib-fs/fs-api-private.h +++ b/src/lib-fs/fs-api-private.h @@ -163,7 +163,6 @@ extern const struct fs fs_class_test; void fs_class_register(const struct fs *fs_class); void fs_set_error(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3); -void fs_set_critical(struct fs *fs, const char *fmt, ...) ATTR_FORMAT(2, 3); void fs_set_error_async(struct fs *fs); diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 7e5ddc7b5e..0e09142482 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -1225,17 +1225,6 @@ void fs_set_error(struct fs *fs, const char *fmt, ...) va_end(args); } -void fs_set_critical(struct fs *fs, const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - fs_set_verror(fs, fmt, args); - - e_error(fs->event, "%s", fs_last_error(fs)); - va_end(args); -} - void fs_set_error_async(struct fs *fs) { fs_set_error(fs, "Asynchronous operation in progress");