mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:27:43 +00:00
LibC: Implement fflush(nullptr)
This caused all open file streams to be flushed. This commit also changes `FILE::create` to handle buffer allocation failure gracefully.
This commit is contained in:
parent
b4e864d02d
commit
6a6dbf5b0b
3 changed files with 72 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibC/bits/FILE.h>
|
||||
#include <LibC/bits/pthread_integration.h>
|
||||
|
@ -127,6 +128,10 @@ private:
|
|||
pid_t m_popen_child { -1 };
|
||||
Buffer m_buffer;
|
||||
__pthread_mutex_t m_mutex;
|
||||
IntrusiveListNode<FILE> m_list_node;
|
||||
|
||||
public:
|
||||
using List = IntrusiveList<&FILE::m_list_node>;
|
||||
};
|
||||
|
||||
class ScopedFileLock {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue