Visualizer #3
|
@ -1,3 +1,6 @@
|
||||||
|
// For F_SETPIPE_SZ
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -29,6 +32,12 @@ static bool start_message(void)
|
||||||
}
|
}
|
||||||
return false;
|
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);
|
ssize_t ret = write(m_fifo_fd, "{", 1);
|
||||||
|
|
Loading…
Reference in a new issue