[ULOGD RFC 30/30] SQLITE3: move timer initialization to start handler

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

 



Signed-off-by: Holger Eitzenberger <holger@xxxxxxxxxxxxxxxx>

Index: ulogd-netfilter/output/sqlite3/ulogd_output_SQLITE3.c
===================================================================
--- ulogd-netfilter.orig/output/sqlite3/ulogd_output_SQLITE3.c
+++ ulogd-netfilter/output/sqlite3/ulogd_output_SQLITE3.c
@@ -719,14 +719,6 @@ sqlite3_configure(struct ulogd_pluginsta
 	pr_debug("%s: db='%s' table='%s' timer=%d max-backlog=%d\n", pi->id,
 			 db_ce(pi), table_ce(pi), timer_ce(pi), max_backlog_ce(pi));
 
-	/* init timer */
-	priv->timer.cb = sqlite_timer_cb;
-	priv->timer.ival = timer_ce(pi);
-	priv->timer.flags = TIMER_F_PERIODIC;
-	priv->timer.data = pi;
-
-	ulogd_register_timer(&priv->timer);
-
 	return 0;
 }
 
@@ -749,6 +741,15 @@ sqlite3_start(struct ulogd_pluginstance 
 	if (db_start(pi) < 0)
 		return -1;
 
+	/* init timer */
+	priv->timer.cb = sqlite_timer_cb;
+	priv->timer.ival = timer_ce(pi);
+	priv->timer.flags = TIMER_F_PERIODIC;
+	priv->timer.data = pi;
+
+	if (ulogd_register_timer(&priv->timer) < 0)
+		return -1;
+
 	ulogd_log(ULOGD_INFO, "%s: started\n", pi->id);
 
 	return 0;

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