Re: [ULOGD 03/15] Replace timer code by working version

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

 



heitzenberger@xxxxxxxxxx wrote:
> Replace existing timer code by simple and more importantly working
> version.  Current resolution is one second, which may be easily
> extended if need be.

I want to apply this patch since it fixes the current timer code.
Although I don't like it since setitimer() wakes up the daemon every 1
seconds even if there is nothing to do but OK, we can fix this later.

> @@ -59,6 +60,7 @@
>  {
>  	struct ulogd_fd *ufd;
>  	fd_set readset, writeset, exceptset;
> +	struct timeval tv = { .tv_sec = 1, };
>  	int i;
>  
>  	FD_ZERO(&readset);
> @@ -77,7 +79,13 @@
>  			FD_SET(ufd->fd, &exceptset);
>  	}
>  
> -	i = select(maxfd+1, &readset, &writeset, &exceptset, NULL);
> + again:
> +	i = select(maxfd+1, &readset, &writeset, &exceptset, &tv);
> +	if (i < 0) {
> +		if (errno == EINTR)
> +			goto again;
> +	}
> +

Hm, but why select also wakes up every 1 second? I'll continue applying
your patches when I get a reply on this (I cannot apply anyway since the
others depend on this).

BTW, this patch depends on 5/15. Please, your patches must compile
without dependencies.

$ make
[...]
/home/pablo/SVN-netfilter/branches/ulog/ulogd2/src/ulogd.c:835:
undefined reference to `ulogd_timer_check_n_run'

Holger Heitzenberger wrote:
> 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.

I have grep the source code looking for pthread stuff but I didn't find
it, you mean that sqlite3 would need it in the future?

-- 
"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