Visualizer #3

Merged
thomas merged 12 commits from rudi_s into main 2024-05-28 11:21:00 +02:00
1 changed files with 9 additions and 0 deletions
Showing only changes of commit 5fb5a2908d - Show all commits

View File

@ -1,3 +1,6 @@
// For F_SETPIPE_SZ
#define _GNU_SOURCE
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@ -29,6 +32,12 @@ static bool start_message(void)
}
return false;
}
// Increase pipe buffer to prevent/reduce EAGAIN during a JSON
// message to prevent corrupted JSON messages. 1048576 is the
// current maximum as permitted by the Linux kernel.
if (fcntl(m_fifo_fd, F_SETPIPE_SZ, 1048576) < 0) {
perror("fcntl");
}
}
ssize_t ret = write(m_fifo_fd, "{", 1);