kernel: compilation fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-05-26 20:30:39 +02:00
parent 62e14e7580
commit 7cdb967730
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 5 additions and 6 deletions

View File

@ -286,7 +286,7 @@ namespace VFS
bool is_setuid(SharedPtr<Inode> inode);
bool is_setgid(SharedPtr<Inode> inode);
bool is_seekable(VFS::InodeType type);
bool is_seekable(SharedPtr<Inode> inode);
Inode& root_inode();

View File

@ -33,7 +33,7 @@ Result<u64> sys_read(Registers*, SyscallArgs args)
usize nread = TRY(descriptor.inode->read(buf, descriptor.offset, size));
if (VFS::is_seekable(descriptor.inode->type())) descriptor.offset += nread;
if (VFS::is_seekable(descriptor.inode)) descriptor.offset += nread;
return nread;
}
@ -52,12 +52,11 @@ Result<u64> sys_write(Registers*, SyscallArgs args)
if (!descriptor.is_writable()) return err(EBADF);
if (descriptor.should_append() && VFS::is_seekable(descriptor.inode->type()))
descriptor.offset = descriptor.inode->size();
if (descriptor.should_append() && VFS::is_seekable(descriptor.inode)) descriptor.offset = descriptor.inode->size();
usize nwritten = TRY(descriptor.inode->write(buf, descriptor.offset, size));
if (VFS::is_seekable(descriptor.inode->type())) descriptor.offset += nwritten;
if (VFS::is_seekable(descriptor.inode)) descriptor.offset += nwritten;
return nwritten;
}
@ -74,7 +73,7 @@ Result<u64> sys_lseek(Registers*, SyscallArgs args)
if (descriptor.inode->type() == VFS::InodeType::FIFO) return err(ESPIPE);
if (!VFS::is_seekable(descriptor.inode->type())) return descriptor.offset;
if (!VFS::is_seekable(descriptor.inode)) return descriptor.offset;
off_t new_offset;