Skip to content

Commit c405238

Browse files
committed
Return errno from F_OFD_SETLKW failure path in fcntl.
1 parent 15bbdd1 commit c405238

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/OSUtil/linux/fcntl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ErrorOr<int> fcntl(int fd, int cmd, void *arg) {
6666
LIBC_NAMESPACE::syscall_impl<int>(FCNTL_SYSCALL_ID, fd, cmd, &flk64);
6767
// On failure, return
6868
if (ret < 0)
69-
return Error(-1);
69+
return Error(-ret);
7070
// Check for overflow, i.e. the offsets are not the same when cast
7171
// to off_t from off64_t.
7272
if (static_cast<off_t>(flk64.l_len) != flk64.l_len ||

0 commit comments

Comments
 (0)