1
0
Fork 0

make pollfd array global

This commit is contained in:
Daniel Barlow 2024-09-15 21:32:48 +01:00
parent 9b1fc11a59
commit 6a6dd32dea
1 changed files with 6 additions and 5 deletions

View File

@ -31,13 +31,14 @@ int open_shipper_socket(char *pathname) {
return fd; return fd;
} }
struct pollfd fds[] = {
int main(int argc, char * argv[]) {
struct pollfd fds[] = {
{ .fd = 0, .events = POLLIN }, { .fd = 0, .events = POLLIN },
{ .fd = 1, .events = POLLERR }, { .fd = 1, .events = POLLERR },
{ .fd = -1, .events = POLLERR }, { .fd = -1, .events = POLLERR },
}; };
int main(int argc, char * argv[]) {
char * buf = malloc(8192); char * buf = malloc(8192);
int out_bytes = 0; int out_bytes = 0;