aboutsummaryrefslogtreecommitdiffstats
path: root/pinguctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pinguctl.c')
-rw-r--r--pinguctl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/pinguctl.c b/pinguctl.c
index 6788794..02dbe14 100644
--- a/pinguctl.c
+++ b/pinguctl.c
@@ -48,12 +48,16 @@ static int adm_send_cmd(int fd, const char *cmd)
static int adm_recv(int fd)
{
char buf[1024];
- int n;
+ int n, total = 0;
- n = recv(fd, buf, sizeof(buf), 0);
- if (n > 0)
+ while (1) {
+ n = recv(fd, buf, sizeof(buf), 0);
+ if (n <= 0)
+ break;
write(STDOUT_FILENO, buf, n);
- return n;
+ total += n;
+ }
+ return total;
}
int main(int argc, char *argv[])