mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 01:38:52 +00:00
Make VFS test environment build again.
This commit is contained in:
parent
83172e6a4b
commit
981a3ae4b3
Notes:
sideshowbarker
2024-07-19 18:32:34 +09:00
Author: https://github.com/awesomekling
Commit: 981a3ae4b3
12 changed files with 40 additions and 34 deletions
|
@ -3,9 +3,12 @@
|
|||
#include "CharacterDevice.h"
|
||||
#include "sys-errno.h"
|
||||
#include "UnixTypes.h"
|
||||
#include "TTY.h"
|
||||
#include <AK/BufferStream.h>
|
||||
|
||||
#ifdef SERENITY
|
||||
#include "TTY.h"
|
||||
#endif
|
||||
|
||||
RetainPtr<FileDescriptor> FileDescriptor::create(RetainPtr<VirtualFileSystem::Node>&& vnode)
|
||||
{
|
||||
return adopt(*new FileDescriptor(move(vnode)));
|
||||
|
@ -178,7 +181,8 @@ ssize_t FileDescriptor::get_dir_entries(byte* buffer, Unix::size_t size)
|
|||
memcpy(buffer, tempBuffer.pointer(), stream.offset());
|
||||
return stream.offset();
|
||||
}
|
||||
|
||||
\
|
||||
#ifdef SERENITY
|
||||
bool FileDescriptor::isTTY() const
|
||||
{
|
||||
if (auto* device = m_vnode->characterDevice())
|
||||
|
@ -199,6 +203,7 @@ TTY* FileDescriptor::tty()
|
|||
return static_cast<TTY*>(device);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
int FileDescriptor::close()
|
||||
{
|
||||
|
@ -207,7 +212,9 @@ int FileDescriptor::close()
|
|||
|
||||
String FileDescriptor::absolute_path() const
|
||||
{
|
||||
#ifdef SERENITY
|
||||
if (isTTY())
|
||||
return tty()->ttyName();
|
||||
#endif
|
||||
return VirtualFileSystem::the().absolutePath(m_vnode->inode);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue