summaryrefslogtreecommitdiffstats
path: root/qarsh.c
diff options
context:
space:
mode:
Diffstat (limited to 'qarsh.c')
-rw-r--r--qarsh.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/qarsh.c b/qarsh.c
index cf80d96..de963fb 100644
--- a/qarsh.c
+++ b/qarsh.c
@@ -45,6 +45,7 @@
#include "hbeat.h"
#define QARSH_MINPORT 5010
+#define QARSH_BUFSIZE 4096
/* Globals */
@@ -264,8 +265,8 @@ run_remote_cmd(char *cmdline)
"fcntl stdin O_NONBLOCK failed, %d: %s\n",
errno, strerror(errno));
}
- buf = malloc(1024);
- memset(buf, 0, 1024);
+ buf = malloc(QARSH_BUFSIZE);
+ memset(buf, 0, QARSH_BUFSIZE);
hbeat(qarsh_hb);
cmd_finished = 0;
@@ -278,7 +279,7 @@ run_remote_cmd(char *cmdline)
timeout.tv_nsec = 0;
}
testfds = readfds;
- memset(buf, 0, 1024);
+ memset(buf, 0, QARSH_BUFSIZE);
nset = pselect(FD_SETSIZE, &testfds, NULL, NULL, &timeout,
&pselect_sigmask);
@@ -314,7 +315,7 @@ run_remote_cmd(char *cmdline)
hbeat_setstate(qarsh_hb, HOST_ALIVE);
if (nset && FD_ISSET(fileno(stdin), &testfds)) {
- bufsize = read(fileno(stdin), buf, 1024);
+ bufsize = read(fileno(stdin), buf, QARSH_BUFSIZE);
if (bufsize > 0) {
write(c_in, buf, bufsize);
} else if (bufsize == 0) {
@@ -326,7 +327,7 @@ run_remote_cmd(char *cmdline)
nset--;
}
if (nset && c_out && FD_ISSET(c_out, &testfds)) {
- bufsize = read(c_out, buf, 1024);
+ bufsize = read(c_out, buf, QARSH_BUFSIZE);
if (bufsize > 0) {
write(fileno(stdout), buf, bufsize);
} else if (bufsize == 0) {
@@ -337,7 +338,7 @@ run_remote_cmd(char *cmdline)
nset--;
}
if (nset && c_err && FD_ISSET(c_err, &testfds)) {
- bufsize = read(c_err, buf, 1024);
+ bufsize = read(c_err, buf, QARSH_BUFSIZE);
if (bufsize > 0) {
write(fileno(stderr), buf, bufsize);
} else if (bufsize == 0) {