mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:38:11 +00:00
Kernel: Do not panic on fstat(fifo)
Instead, let's return an empty buffer with st_mode indicating it's a fifo.
This commit is contained in:
parent
68c06b8fac
commit
e9dd94063f
1 changed files with 6 additions and 1 deletions
|
@ -48,7 +48,12 @@ FileDescription::~FileDescription()
|
||||||
|
|
||||||
KResult FileDescription::fstat(stat& buffer)
|
KResult FileDescription::fstat(stat& buffer)
|
||||||
{
|
{
|
||||||
ASSERT(!is_fifo());
|
if (is_fifo()) {
|
||||||
|
memset(&buffer, 0, sizeof(buffer));
|
||||||
|
buffer.st_mode = 001000;
|
||||||
|
return KSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_inode)
|
if (!m_inode)
|
||||||
return KResult(-EBADF);
|
return KResult(-EBADF);
|
||||||
return metadata().stat(buffer);
|
return metadata().stat(buffer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue