From: Timo Sirainen Date: Fri, 29 Nov 2019 14:01:40 +0000 (+0200) Subject: fs-posix: Change fs_posix_rmdir_parents() to take fs_file instead of fs X-Git-Tag: 2.3.10~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c97b554189edbd0a11fc5f8b17345a2cd2ab5f1;p=thirdparty%2Fdovecot%2Fcore.git fs-posix: Change fs_posix_rmdir_parents() to take fs_file instead of fs --- diff --git a/src/lib-fs/fs-posix.c b/src/lib-fs/fs-posix.c index 7e21c87cff..5140eeba23 100644 --- a/src/lib-fs/fs-posix.c +++ b/src/lib-fs/fs-posix.c @@ -215,8 +215,9 @@ static int fs_posix_mkdir_parents(struct posix_fs_file *file, const char *path) } } -static int fs_posix_rmdir_parents(struct posix_fs *fs, const char *path) +static int fs_posix_rmdir_parents(struct posix_fs_file *file, const char *path) { + struct posix_fs *fs = (struct posix_fs *)file->file.fs; const char *p; if (fs->have_dirs) @@ -238,7 +239,7 @@ static int fs_posix_rmdir_parents(struct posix_fs *fs, const char *path) /* some other not-unexpected error */ break; } else { - fs_set_error(&fs->fs, "rmdir(%s) failed: %m", path); + fs_set_error(file->file.fs, "rmdir(%s) failed: %m", path); return -1; } } @@ -838,7 +839,6 @@ static int fs_posix_delete(struct fs_file *_file) { struct posix_fs_file *file = container_of(_file, struct posix_fs_file, file); - struct posix_fs *fs = container_of(_file->fs, struct posix_fs, fs); if (unlink(file->full_path) < 0) { if (!UNLINK_EISDIR(errno)) { @@ -852,7 +852,7 @@ static int fs_posix_delete(struct fs_file *_file) return -1; } } - (void)fs_posix_rmdir_parents(fs, file->full_path); + (void)fs_posix_rmdir_parents(file, file->full_path); return 0; }