dovecot-2.2: lib: file_wait_lock*(): Improve the panic log messa...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Sep 19 22:06:09 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/4f4243794ba1
changeset: 19156:4f4243794ba1
user: Timo Sirainen <tss at iki.fi>
date: Sun Sep 20 01:04:50 2015 +0300
description:
lib: file_wait_lock*(): Improve the panic log message on EDEADLOCK.
diffstat:
src/lib/file-lock.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r 7cf44f5f32bd -r 4f4243794ba1 src/lib/file-lock.c
--- a/src/lib/file-lock.c Thu Sep 17 07:33:22 2015 +0900
+++ b/src/lib/file-lock.c Sun Sep 20 01:04:50 2015 +0300
@@ -211,6 +211,8 @@
}
*error_r = t_strdup_printf("fcntl(%s, %s, %s) locking failed: %m",
path, lock_type_str, timeout_secs == 0 ? "F_SETLK" : "F_SETLKW");
+ if (errno == EDEADLOCK)
+ i_panic("%s%s", *error_r, file_lock_find(fd, lock_method, lock_type));
return -1;
#endif
}
@@ -257,6 +259,8 @@
}
*error_r = t_strdup_printf("flock(%s, %s) failed: %m",
path, lock_type_str);
+ if (errno == EDEADLOCK)
+ i_panic("%s%s", *error_r, file_lock_find(fd, lock_method, lock_type));
return -1;
#endif
}
@@ -292,10 +296,8 @@
int ret;
ret = file_lock_do(fd, path, lock_type, lock_method, timeout_secs, error_r);
- if (ret <= 0) {
- i_assert(errno != EDEADLOCK);
+ if (ret <= 0)
return ret;
- }
lock = i_new(struct file_lock, 1);
lock->fd = fd;
More information about the dovecot-cvs
mailing list