mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03: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
Notes:
sideshowbarker
2024-07-19 12:04:17 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/e9dd94063fc Pull-request: https://github.com/SerenityOS/serenity/pull/580
@ -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…
Reference in New Issue
Block a user