From 0f67e863082a0b99c444003ec40b57ac6b8c313d Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 17 Jan 2011 12:02:22 +0000 Subject: [PATCH] handle failure to register inotify shutdown function Origin: vendor, Maemo Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128 Bug-NB: NB#180486 Reviewed-by: Simon McVittie --- bus/dir-watch-inotify.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index 39eff97..461b8ee 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -259,7 +259,13 @@ _init_inotify (BusContext *context) goto out; } - _dbus_register_shutdown_func (_shutdown_inotify, NULL); + if (!_dbus_register_shutdown_func (_shutdown_inotify, NULL)) + { + _dbus_warn ("Unable to register shutdown func"); + _dbus_watch_unref (watch); + watch = NULL; + goto out; + } } ret = 1; -- 2.7.4