kernel/fs/fd: fcntl(F_DUPFD) should return EINVAL for invalid fds.
fix a failure for test-fcntl.c of gltests. Change-Id: Ied8effdee2ddd9868bf039dbf74a3057a2541cac Reviewed-on: https://review.haiku-os.org/c/1331 Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
ebc14c9921
commit
532998ed1e
@ -159,6 +159,9 @@ new_fd_etc(struct io_context* context, struct file_descriptor* descriptor,
|
||||
int fd = -1;
|
||||
uint32 i;
|
||||
|
||||
if (firstIndex < 0 || (uint32)firstIndex >= context->table_size)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
mutex_lock(&context->io_mutex);
|
||||
|
||||
for (i = firstIndex; i < context->table_size; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user