From: Timo Sirainen Date: Tue, 6 Feb 2018 15:49:15 +0000 (+0200) Subject: lib-storage: Change mail_user_lock_file_create() to use mail_storage_lock_create() X-Git-Tag: 2.3.9~2364 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9eb5adf5cc773c1e27ae30dd6aa2bc150ae81ac1;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Change mail_user_lock_file_create() to use mail_storage_lock_create() --- diff --git a/src/lib-storage/mail-user.c b/src/lib-storage/mail-user.c index 5f61db4c12..35985c4c8f 100644 --- a/src/lib-storage/mail-user.c +++ b/src/lib-storage/mail-user.c @@ -566,8 +566,7 @@ int mail_user_lock_file_create(struct mail_user *user, const char *lock_fname, unsigned int lock_secs, struct file_lock **lock_r, const char **error_r) { - bool created; - const char *home, *path, *error; + const char *home, *path; int ret; if ((ret = mail_user_get_home(user, &home)) < 0) { @@ -597,14 +596,7 @@ int mail_user_lock_file_create(struct mail_user *user, const char *lock_fname, lock_fname); lock_set.mkdir_mode = 0700; } - - if (file_create_locked(path, &lock_set, lock_r, &created, &error) == -1) { - *error_r = t_strdup_printf("file_create_locked(%s) failed: %s", path, error); - return errno == EAGAIN ? 0 : -1; - } - file_lock_set_unlink_on_free(*lock_r, TRUE); - file_lock_set_close_on_free(*lock_r, TRUE); - return 1; + return mail_storage_lock_create(path, &lock_set, lock_r, error_r); } const char *mail_user_get_anvil_userip_ident(struct mail_user *user)