INNER CODE UNIT · C
nfds
ukanth/afwall · external/nflog/nflog.c:645
nfds = (sock_fd > stdin_fd ? sock_fd : stdin_fd) + 1;
if (fcntl(sock_fd, F_SETFL, O_NONBLOCK) < 0 ||
fcntl(stdin_fd, F_SETFL, O_NONBLOCK) < 0) {
perror("fcntl");
exit(EXIT_FAILURE);
}
fprintf(stderr, "Enhanced NFLOG started on queue %u\n", qnum);
// Enhanced main loop with better error handling
while (!shutdown_requested) {
fd_set fds;
char c;
int select_result;
FD_ZERO(&fds);
FD_SET(sock_fd, &fds);