]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Add fs_set_error_errno()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 21 Jan 2020 13:50:07 +0000 (15:50 +0200)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 22 Jan 2020 18:40:17 +0000 (13:40 -0500)
This is in preparation for adding errno parameter for fs_set_error().

src/lib-fs/fs-api-private.h
src/lib-fs/fs-api.c

index e541534731a856ffbccb87b0d0e5b745dbbcda9d..28394bc37af4ceb149476fcafcc17d9420745e6d 100644 (file)
@@ -170,6 +170,7 @@ void fs_class_register(const struct fs *fs_class);
 
 /* Event must be fs_file or fs_iter events */
 void fs_set_error(struct event *event, const char *fmt, ...) ATTR_FORMAT(2, 3);
+void fs_set_error_errno(struct event *event, const char *fmt, ...) ATTR_FORMAT(2, 3);
 void fs_file_set_error_async(struct fs_file *file);
 
 ssize_t fs_read_via_stream(struct fs_file *file, void *buf, size_t size);
index dd9c3daa7b87a25ca0387bc8270bf469e959bbf8..3ba76c6d222ce15b0f960dc9932d87a04105cac6 100644 (file)
@@ -1293,6 +1293,17 @@ void fs_set_error(struct event *event, const char *fmt, ...)
        va_end(args);
 }
 
+void fs_set_error_errno(struct event *event, const char *fmt, ...)
+{
+       va_list args;
+
+       i_assert(errno != 0);
+
+       va_start(args, fmt);
+       fs_set_verror(event, fmt, args);
+       va_end(args);
+}
+
 void fs_file_set_error_async(struct fs_file *file)
 {
        errno = EAGAIN;