mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
Kernel: Add InodeFile, a File subclass for regular files.
Finally everything that can be held by a FileDescriptor actually inherits from the File class.
This commit is contained in:
@@ -1608,9 +1608,7 @@ int Process::sys$ioctl(int fd, unsigned request, unsigned arg)
|
||||
auto* descriptor = file_descriptor(fd);
|
||||
if (!descriptor)
|
||||
return -EBADF;
|
||||
if (!descriptor->is_file())
|
||||
return -ENOTTY;
|
||||
return descriptor->file()->ioctl(*descriptor, request, arg);
|
||||
return descriptor->file().ioctl(*descriptor, request, arg);
|
||||
}
|
||||
|
||||
int Process::sys$getdtablesize()
|
||||
@@ -2717,8 +2715,6 @@ int Process::sys$ftruncate(int fd, off_t length)
|
||||
if (!descriptor)
|
||||
return -EBADF;
|
||||
// FIXME: Check that fd is writable, otherwise EINVAL.
|
||||
if (!descriptor->is_file() && !descriptor->is_shared_memory())
|
||||
return -EINVAL;
|
||||
return descriptor->truncate(length);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user