dbus/dbus dbus-sysdeps.c,1.68,1.69 dbus-sysdeps.h,1.38,1.39

Mikael Hallendal micke@pdx.freedesktop.org
Fri, 12 Mar 2004 06:07:18 -0800


Update of /cvs/dbus/dbus/dbus
In directory pdx:/tmp/cvs-serv10529/dbus

Modified Files:
	dbus-sysdeps.c dbus-sysdeps.h 
Log Message:
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.



Index: dbus-sysdeps.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- a/dbus-sysdeps.c	2 Dec 2003 10:44:21 -0000	1.68
+++ b/dbus-sysdeps.c	12 Mar 2004 14:07:16 -0000	1.69
@@ -2419,6 +2419,34 @@
 }
 
 /**
+ * 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//"

Index: dbus-sysdeps.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- a/dbus-sysdeps.h	5 Mar 2004 14:05:33 -0000	1.38
+++ b/dbus-sysdeps.h	12 Mar 2004 14:07:16 -0000	1.39
@@ -233,6 +233,8 @@
                                               DBusError        *error);
 dbus_bool_t    _dbus_create_directory        (const DBusString *filename,
                                               DBusError        *error);
+dbus_bool_t    _dbus_delete_directory        (const DBusString *filename,
+					      DBusError        *error);
 
 dbus_bool_t _dbus_concat_dir_and_file (DBusString       *dir,
                                        const DBusString *next_component);