Verified Commit 5a09ba46 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

subprocess: Use BUFSIZ in pipes read

Instead of pretty small constant lets use system level compilation
constant BUFSIZ. Thanks to that we should have buffer exactly matched to
stdio buffer which should somewhat ensure better performance. It is
minor thing but it is better to do it non the less.
parent dc1bce93
......@@ -139,9 +139,9 @@ int subprocloc(int timeout, FILE *fd[2], subproc_callback callback, void *data,
int dead = 0;
for (int i = 0; i < 2; i++) {
if (pfds[i].revents & POLLIN) {
char *buff[64];
char *buff[BUFSIZ];
ssize_t loaded;
while ((loaded = read(pfds[i].fd, buff, 64)) > 0)
while ((loaded = read(pfds[i].fd, buff, BUFSIZ)) > 0)
fwrite(buff, sizeof(char), loaded, fd[i]);
if (pfds[i].revents & POLLHUP)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment