Re: [ULOGD RFC 05/30] Add signalling subsystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



heitzenberger@xxxxxxxxxx wrote:
> This patch adds the concept of synchronous and asynchronous signal
> handlers to ulogd, where 'synchronous' just means to be synchronous to
> the underlying IO multiplexer.

Interesting.

> Will later be used by plugins like SQLITE3 and NFCT.
> 
> One of the changes herein is the usage of the pthread library.  This
> is strictly necessary because some plugins might (and SQLITE3 *does*)
> use pthreads.
> Index: ulogd-netfilter/src/select.c
> ===================================================================
> --- ulogd-netfilter.orig/src/select.c
> +++ ulogd-netfilter/src/select.c
> @@ -23,6 +23,7 @@
>  
>  #include <fcntl.h>
>  #include <ulogd/ulogd.h>
> +#include <ulogd/common.h>
>  #include <ulogd/linuxlist.h>
>  
>  static int maxfd = 0;
> @@ -59,6 +60,7 @@ int ulogd_select_main()
>  {
>  	struct ulogd_fd *ufd;
>  	fd_set readset, writeset, exceptset;
> +	struct timeval tv = { .tv_sec = 1, };
>  	int i;
>  
>  	FD_ZERO(&readset);
> @@ -77,7 +79,13 @@ int ulogd_select_main()
>  			FD_SET(ufd->fd, &exceptset);
>  	}
>  
> -	i = select(maxfd+1, &readset, &writeset, &exceptset, NULL);
> + again:
> +	i = select(maxfd+1, &readset, &writeset, &exceptset, &tv);

Hm, why do we poll now every 1 second event even if there's nothing to do?

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux