commit 6a6dd32dea75fd3cb6ebee061af757a9d4d51666
parent 9b1fc11a597c4f05dae0e225f292a0c31f17718b
Author: Daniel Barlow <dan@telent.net>
Date: Sun, 15 Sep 2024 21:32:48 +0100
make pollfd array global
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/pkgs/logshipper/logtee.c b/pkgs/logshipper/logtee.c
@@ -31,13 +31,14 @@ int open_shipper_socket(char *pathname) {
return fd;
}
+struct pollfd fds[] = {
+ { .fd = 0, .events = POLLIN },
+ { .fd = 1, .events = POLLERR },
+ { .fd = -1, .events = POLLERR },
+};
+
int main(int argc, char * argv[]) {
- struct pollfd fds[] = {
- { .fd = 0, .events = POLLIN },
- { .fd = 1, .events = POLLERR },
- { .fd = -1, .events = POLLERR },
- };
char * buf = malloc(8192);
int out_bytes = 0;