Mercurial > dovecot > core-2.2
comparison src/lib-storage/index/dbox-common/dbox-storage.c @ 19136:fefaa6d09a81
Replaced unlink() calls with i_unlink*() wherever possible.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 08 Sep 2015 19:07:02 +0300 |
parents | f84c81ed5d09 |
children | 0f22db71df7a |
comparison
equal
deleted
inserted
replaced
19135:2ec2b0a51fec | 19136:fefaa6d09a81 |
---|---|
75 if (!dbox_alt_path_has_changed(root_dir, alt_path, alt_path2, | 75 if (!dbox_alt_path_has_changed(root_dir, alt_path, alt_path2, |
76 alt_symlink_path)) | 76 alt_symlink_path)) |
77 return; | 77 return; |
78 | 78 |
79 /* unlink/create the current alt path symlink */ | 79 /* unlink/create the current alt path symlink */ |
80 if (unlink(alt_symlink_path) < 0 && errno != ENOENT) | 80 i_unlink_if_exists(alt_symlink_path); |
81 i_error("unlink(%s) failed: %m", alt_symlink_path); | |
82 if (alt_path != NULL) { | 81 if (alt_path != NULL) { |
83 if (symlink(alt_path, alt_symlink_path) < 0 && | 82 if (symlink(alt_path, alt_symlink_path) < 0 && |
84 errno != EEXIST) { | 83 errno != EEXIST) { |
85 i_error("symlink(%s, %s) failed: %m", | 84 i_error("symlink(%s, %s) failed: %m", |
86 alt_path, alt_symlink_path); | 85 alt_path, alt_symlink_path); |