}
*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 == EDEADLK) {
+ if (errno == EDEADLK && !set->allow_deadlock) {
i_panic("%s%s", *error_r,
file_lock_find(fd, set->lock_method,
lock_type));
}
*error_r = t_strdup_printf("flock(%s, %s) failed: %m",
path, lock_type_str);
- if (errno == EDEADLK) {
+ if (errno == EDEADLK && !set->allow_deadlock) {
i_panic("%s%s", *error_r,
file_lock_find(fd, set->lock_method,
lock_type));
processes are already waiting on the lock. This can be useful for
files that are only created to exist as lock files. */
bool close_on_free:1;
+ /* Do not panic when the kernel returns EDEADLK while acquiring the
+ lock. */
+ bool allow_deadlock:1;
};
/* Parse lock method from given string. Returns TRUE if ok,