mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 08:35:26 +00:00
Before sys$write returns, check for pending unmasked signals.
If there is one, put the process into a new BlockedSignal state which makes the next scheduler iteration dispatch the signal.
This commit is contained in:
@@ -978,6 +978,12 @@ ssize_t Process::sys$write(int fd, const void* data, size_t size)
|
||||
if (!descriptor)
|
||||
return -EBADF;
|
||||
auto nwritten = descriptor->write((const byte*)data, size);
|
||||
if (has_unmasked_pending_signals()) {
|
||||
block(BlockedSignal);
|
||||
Scheduler::yield();
|
||||
if (nwritten == 0)
|
||||
return -EINTR;
|
||||
}
|
||||
#ifdef DEBUG_IO
|
||||
kprintf("Process::sys$write: nwritten=%u\n", nwritten);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user