Re: [PATCH 2/4] don't ignore fd events when an alarm is due

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

 



On 2008/01/21 14:14, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> Max Kellermann wrote:
> > also, pass &next_alarm to __run() only if there is an alarm; eliminate
> > the "timeout" parameter; the alarm functions get_next_alarm_run() and
> > do_alarm_run() return an timeval pointer instead of a boolean.
> 
> Hm, this patch makes my CPU suck up after the first alarm run.

Damn.  I forgot a "!".

commit 02683a053a26e142e8067b0e884ff5c49af908d4
Author: Max Kellermann <max@xxxxxxxxxxx>
Date:   Mon Jan 21 15:13:38 2008 +0100

    added "!" before timerisset(next)

diff --git a/src/run.c b/src/run.c
index 718e63c..fe57858 100644
--- a/src/run.c
+++ b/src/run.c
@@ -237,7 +237,7 @@ run(void)
 
 	while(1) {
 		sigprocmask(SIG_BLOCK, &STATE(block), NULL);
-		if (next != NULL && timerisset(next))
+		if (next != NULL && !timerisset(next))
 			next = do_alarm_run(&next_alarm);
 		else
 			next = get_next_alarm_run(&next_alarm);
-
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