mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05: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)
|
||||
{
|
||||
ASSERT(!is_fifo());
|
||||
if (is_fifo()) {
|
||||
memset(&buffer, 0, sizeof(buffer));
|
||||
buffer.st_mode = 001000;
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
if (!m_inode)
|
||||
return KResult(-EBADF);
|
||||
return metadata().stat(buffer);
|
||||
|
|
Loading…
Add table
Reference in a new issue