hal/hald device_info.c,1.15,1.16

David Zeuthen david at freedesktop.org
Thu Oct 14 11:37:30 PDT 2004


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv19112/hald

Modified Files:
	device_info.c 
Log Message:
2004-10-14  David Zeuthen  <davidz at redhat.com>

	* configure.in: Add fstab-sync.8 to AC_OUTPUT
	
	* doc/conf/storage-non-fixed.fdi: New file, example

	* doc/conf/storage-skip-all.fdi: New file, example

	* doc/conf/Makefile.am: Dist and install two new .fdi files

	* fdi/90defaultpolicy/storage-policy.fdi: Fix a typo in a comment

	* hald/device_info.c:
	(my_alphasort): New function 
	(scan_fdi_files): Use my_alphasort to sort in the right order. Process
	all .fdi files instead of bailing out on the first match.

	* hald/linux/osspec.c:
	(get_selinux_removable_context): New function, copied over from 
	tools/fstab-sync.c (not currently used)
	(osspec_probe): Use get_selinux_removable_context (not currently used)

	* libhal-storage/libhal-storage.c:
	(hal_drive_policy_get_mount_options): Check if mount_option property
	is actually FALSE.
	(hal_volume_policy_get_mount_options): Same

	* libhal/libhal.c:
	(hal_free_property_set): Check if object to free is NULL and just
	return. Allows hal_free_property_set (NULL).

	* tools/Makefile.am: Add rules for building fstab-sync.8 man page

	* tools/fstab-sync.8.in: New file

	* tools/fstab-sync.c: Much rewritten to use libhal-storage and the new
	policy properties. See diff for details.



Index: device_info.c
===================================================================
RCS file: /cvs/hal/hal/hald/device_info.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- device_info.c	13 Oct 2004 18:50:45 -0000	1.15
+++ device_info.c	14 Oct 2004 18:37:28 -0000	1.16
@@ -1062,6 +1062,13 @@
 
 
 
+static int 
+my_alphasort(const void *a, const void *b)
+{
+	return -alphasort (a, b);
+}
+
+
 /** Scan all directories and subdirectories in the given directory and
  *  process each *.fdi file
  *
@@ -1080,7 +1087,7 @@
 
 	/*HAL_INFO(("scan_fdi_files: Processing dir '%s'", dir));*/
 
-	num_entries = scandir (dir, &name_list, 0, alphasort);
+	num_entries = scandir (dir, &name_list, 0, my_alphasort);
 	if (num_entries == -1) {
 		perror ("scandir");
 		return FALSE;
@@ -1108,14 +1115,11 @@
 			    filename[len - 3] == 'f' &&
 			    filename[len - 2] == 'd' &&
 			    filename[len - 1] == 'i') {
-				/*HAL_INFO (("scan_fdi_files: Processing "
-				  "file '%s'", filename));*/
-				found_fdi_file =
-				    process_fdi_file (dir, filename, d);
+				HAL_INFO (("scan_fdi_files: Processing file '%s'", filename));
+				found_fdi_file = process_fdi_file (dir, filename, d);
 				if (found_fdi_file) {
-					/*HAL_INFO (("*** Matched file %s/%s", 
-					  dir, filename));*/
-					break;
+					HAL_INFO (("*** Matched file %s/%s", dir, filename));
+					/*break;*/
 				}
 			}
 
@@ -1141,8 +1145,10 @@
 				  filename);
 			found_fdi_file = scan_fdi_files (dirname, d);
 			free (dirname);
+			/*
 			if (found_fdi_file)
 				break;
+			*/
 		}
 
 		g_free (full_path);




More information about the hal-commit mailing list