]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: file_wait_lock_error() assert-crashes now on EDEADLOCK
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Sep 2015 01:46:44 +0000 (10:46 +0900)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Sep 2015 01:46:44 +0000 (10:46 +0900)
It's always a bug and a crash can help debug it.

src/lib/file-lock.c

index 7cf474e477ef285d679f9ea85a35725386a64990..1ccdbc692ab8c0b1d5f42705aa9e7f534949e3ad 100644 (file)
@@ -292,8 +292,10 @@ int file_wait_lock_error(int fd, const char *path, int lock_type,
        int ret;
 
        ret = file_lock_do(fd, path, lock_type, lock_method, timeout_secs, error_r);
-       if (ret <= 0)
+       if (ret <= 0) {
+               i_assert(errno != EDEADLOCK);
                return ret;
+       }
 
        lock = i_new(struct file_lock, 1);
        lock->fd = fd;