diff options
author | June McEnroe <programble@gmail.com> | 2018-02-22 15:30:12 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-22 15:30:12 -0500 |
commit | d37e895fb7955f6090b02a125236282e1858b53c (patch) | |
tree | 3195d6be8245dbc5393a72944a779e12954fc358 /ingest.c | |
parent | Handle EINTR from kevent (diff) | |
download | stream-d37e895fb7955f6090b02a125236282e1858b53c.tar.gz stream-d37e895fb7955f6090b02a125236282e1858b53c.zip |
Factor out STREAM_SIZE for ingest and broadcast
Diffstat (limited to '')
-rw-r--r-- | ingest.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ingest.c b/ingest.c index 9fa754d..6ba387b 100644 --- a/ingest.c +++ b/ingest.c @@ -22,6 +22,8 @@ #include <sysexits.h> #include <unistd.h> +#include "stream.h" + int main(int argc, char *argv[]) { if (argc < 2) return EX_USAGE; const char *path = argv[1]; @@ -49,7 +51,7 @@ int main(int argc, char *argv[]) { char buf[4096]; ssize_t totalSize = 0; - while (totalSize < 1024 * 1024) { + while (totalSize < STREAM_SIZE) { ssize_t readSize = read(remote, buf, sizeof(buf)); if (readSize < 0) err(EX_IOERR, "read(%d)", remote); if (!readSize) return EX_OK; |