Commit d71ba930 authored by Alexandre Julliard's avatar Alexandre Julliard

Ignore fcntl failure when setting a write lock on a read only file.

parent 25fe3610
...@@ -538,6 +538,12 @@ static int set_unix_lock( const struct fd *fd, file_pos_t start, file_pos_t end, ...@@ -538,6 +538,12 @@ static int set_unix_lock( const struct fd *fd, file_pos_t start, file_pos_t end,
case EAGAIN: case EAGAIN:
set_error( STATUS_FILE_LOCK_CONFLICT ); set_error( STATUS_FILE_LOCK_CONFLICT );
return 0; return 0;
case EBADF:
/* this can happen if we try to set a write lock on a read-only file */
/* we just ignore that error */
if (fl.l_type == F_WRLCK) return 1;
set_error( STATUS_ACCESS_DENIED );
return 0;
case EOVERFLOW: case EOVERFLOW:
/* this can happen if off_t is 64-bit but the kernel only supports 32-bit */ /* this can happen if off_t is 64-bit but the kernel only supports 32-bit */
/* in that case we shrink the limit and retry */ /* in that case we shrink the limit and retry */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment