handle failure to register inotify shutdown function
authorChristian Dywan <christian.dywan@lanedo.com>
Mon, 17 Jan 2011 12:02:22 +0000 (12:02 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 17 Jan 2011 12:02:30 +0000 (12:02 +0000)
Origin: vendor, Maemo
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128
Bug-NB: NB#180486
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/dir-watch-inotify.c

index 39eff97..461b8ee 100644 (file)
@@ -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;