"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib-index/mail-index-strmap.c" between
dovecot-2.3.16.tar.gz and dovecot-2.3.17.tar.gz

About: Dovecot is an IMAP and POP3 server, written with security primarily in mind.

mail-index-strmap.c  (dovecot-2.3.16):mail-index-strmap.c  (dovecot-2.3.17)
skipping to change at line 1042 skipping to change at line 1042
ret = -1; ret = -1;
} }
if (ret < 0) if (ret < 0)
i_unlink(temp_path); i_unlink(temp_path);
return ret; return ret;
} }
static int mail_index_strmap_lock(struct mail_index_strmap *strmap) static int mail_index_strmap_lock(struct mail_index_strmap *strmap)
{ {
unsigned int timeout_secs; unsigned int timeout_secs;
const char *error;
int ret; int ret;
i_assert(strmap->fd != -1); i_assert(strmap->fd != -1);
if (strmap->index->set.lock_method != FILE_LOCK_METHOD_DOTLOCK) { if (strmap->index->set.lock_method != FILE_LOCK_METHOD_DOTLOCK) {
i_assert(strmap->file_lock == NULL); i_assert(strmap->file_lock == NULL);
struct file_lock_settings lock_set = {
.lock_method = strmap->index->set.lock_method,
};
timeout_secs = I_MIN(MAIL_INDEX_STRMAP_TIMEOUT_SECS, timeout_secs = I_MIN(MAIL_INDEX_STRMAP_TIMEOUT_SECS,
strmap->index->set.max_lock_timeout_secs); strmap->index->set.max_lock_timeout_secs);
ret = file_wait_lock(strmap->fd, strmap->path, F_WRLCK, ret = file_wait_lock(strmap->fd, strmap->path, F_WRLCK,
strmap->index->set.lock_method, timeout_secs &lock_set, timeout_secs,
, &strmap->file_lock, &error);
&strmap->file_lock);
if (ret <= 0) { if (ret <= 0) {
mail_index_strmap_set_syscall_error(strmap, mail_index_set_error(strmap->index,
"file_wait_lock()"); "file_wait_lock() failed with strmap index file %
s: %s",
strmap->path, error);
} }
} else { } else {
i_assert(strmap->dotlock == NULL); i_assert(strmap->dotlock == NULL);
ret = file_dotlock_create(&strmap->dotlock_settings, ret = file_dotlock_create(&strmap->dotlock_settings,
strmap->path, 0, &strmap->dotlock); strmap->path, 0, &strmap->dotlock);
if (ret <= 0) { if (ret <= 0) {
mail_index_strmap_set_syscall_error(strmap, mail_index_strmap_set_syscall_error(strmap,
"file_dotlock_create()"); "file_dotlock_create()");
} }
 End of changes. 4 change blocks. 
5 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)