summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.c
diff options
context:
space:
mode:
authorMikael Hallendal <micke@imendio.com>2004-03-12 14:07:16 +0000
committerMikael Hallendal <micke@imendio.com>2004-03-12 14:07:16 +0000
commitdd79fc73f08574698c18c6a35dc309d5ef33fde0 (patch)
tree31c211a1dfe5b463cf3c63ddfab838f8ce3538f1 /dbus/dbus-sysdeps.c
parent387510da641d1b91cd5369e292e6203e376da1a2 (diff)
2004-03-12 Mikael Hallendal <micke@imendio.com>
* bus/activation.c: - Added service file reloading. Each service files directory is kept in an hash table in BusActivation and each BusActivationEntry knows what .service-file it was read from. So when you try to activate a service the bus will check if it's been updated, removed or if new .service-files has been installed. - Test code at the bottom for the service file reloading. * bus/test-main.c: (main): * bus/test.h: - added service reloading test. * dbus/dbus-sysdeps.c: * dbus/dbus-sysdeps.h: (_dbus_delete_directory): Added.
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r--dbus/dbus-sysdeps.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c
index 2c108a58..0eea35a6 100644
--- a/dbus/dbus-sysdeps.c
+++ b/dbus/dbus-sysdeps.c
@@ -2419,6 +2419,34 @@ _dbus_create_directory (const DBusString *filename,
}
/**
+ * Removes a directory; Directory must be empty
+ *
+ * @param filename directory filename
+ * @param error initialized error object
+ * @returns #TRUE on success
+ */
+dbus_bool_t
+_dbus_delete_directory (const DBusString *filename,
+ DBusError *error)
+{
+ const char *filename_c;
+
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ filename_c = _dbus_string_get_const_data (filename);
+
+ if (rmdir (filename_c) != 0)
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Failed to remove directory %s: %s\n",
+ filename_c, _dbus_strerror (errno));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**
* Appends the given filename to the given directory.
*
* @todo it might be cute to collapse multiple '/' such as "foo//"