hal/hald/linux block_class_device.c,1.82,1.83
David Zeuthen
david at freedesktop.org
Wed Sep 29 07:28:35 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv28376/hald/linux
Modified Files:
block_class_device.c
Log Message:
2004-09-29 David Zeuthen <david at fubar.dk>
* hald/linux/block_class_device.c (detect_disc): Do a CDROM_DRIVE_STATUS
before CDROM_DISC_STATUS
* tools/fstab-sync.c (fs_table_line_is_generated): Use secondary
managed keyword if applicable
(fs_table_add_volume): Use access keyword only if applicable
(volume_new): Also set is_removable
(fs_table_add_volume): Only add removable selinux context for
hotpluggable drives and drives with removable media
* configure.in: Add fstab-sync secondary keyword which is useful for
migration from e.g. kudzu to managed - fstab-sync will only delete
fstab lines with the secondary keyword but never write them. Needs
to be enabled with --enable-mnt-noop-sec.
Also add fstab-sync access keyword which defaults to 'user' but
can be replaced by 'console' - this is useful for specifying the
extra mount option for how to give access. Now the access keyword
needs to be enabled with --enable-mnt-access.
For (my own) reference, this is the parameters used to bootstrap
when building for Red Hat distros
./autogen.sh --enable-mnt-noop --enable-fstab-sync --enable-hotplug-map --with-mnt-noop=managed --enable-mnt-noop-sec --with-mnt-noop-sec=kudzu --enable-mnt-access --with-mnt-access=console --with-init-scripts=redhat --with-pid-file=/var/run/haldaemon.pid --enable-selinux
note: the util-linux package must be patched with the patch in RH bug
133941 in order for --with-mnt-access=console to work; should hit
Rawhide soon.
Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- block_class_device.c 29 Sep 2004 07:59:11 -0000 1.82
+++ block_class_device.c 29 Sep 2004 14:28:32 -0000 1.83
@@ -635,7 +635,14 @@
fd = open (device_file, O_RDONLY | O_NONBLOCK);
if (fd < 0)
return;
-
+
+ /* Suggested by Alex Larsson to get rid of log spewage
+ * on Alan's cd changer (RH bug 130649) */
+ if (ioctl (fd, CDROM_DRIVE_STATUS, CDSL_CURRENT) != CDS_DISC_OK) {
+ close (fd);
+ return;
+ }
+
/* check for audio/data/blank */
type = ioctl (fd, CDROM_DISC_STATUS, CDSL_CURRENT);
switch (type) {
More information about the hal-commit
mailing list