From 95a7399a73782de48d4e821c84bd0fc59a590f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Sat, 27 Jun 2015 15:52:41 +0300 Subject: daemon: clean up {add,remove}_exit_timeout() Add a nonnull assertion, remove unnecessary {} around one return statement --- src/daemon/daemon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index ada9a2d..821de3e 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -182,20 +182,20 @@ static gboolean do_exit(gpointer user_data) static void add_exit_timeout(NotifyDaemon* daemon) { + g_assert_nonnull(daemon); + if (daemon->priv->exit_timeout_source > 0) - { return; - } daemon->priv->exit_timeout_source = g_timeout_add_seconds(IDLE_SECONDS, do_exit, NULL); } static void remove_exit_timeout(NotifyDaemon* daemon) { + g_assert_nonnull(daemon); + if (daemon->priv->exit_timeout_source == 0) - { return; - } g_source_remove(daemon->priv->exit_timeout_source); daemon->priv->exit_timeout_source = 0; -- cgit v1.2.1