[Pkg-utopia-commits] r39 - in packages/hal/trunk/debian: . patches
Sjoerd Simons
sjoerd@haydn.debian.org
Tue, 19 Oct 2004 06:35:22 -0600
Author: sjoerd
Date: 2004-10-19 06:34:57 -0600 (Tue, 19 Oct 2004)
New Revision: 39
Added:
packages/hal/trunk/debian/patches/nonblock.patch
Modified:
packages/hal/trunk/debian/changelog
Log:
Added patch to fix wrong handling of O_NONBLOCK by hal when probing the
fileystem type.
Modified: packages/hal/trunk/debian/changelog
===================================================================
--- packages/hal/trunk/debian/changelog 2004-10-19 12:19:24 UTC (rev 38)
+++ packages/hal/trunk/debian/changelog 2004-10-19 12:34:57 UTC (rev 39)
@@ -30,6 +30,9 @@
to the syslog.
- clean wasn't being called on hald startup because of missing defines
due to the removal of fstab-sync options
+ + Added debian/patches/nonblock.patch (from CVS HEAD)
+ - Fixes wrong handling of O_NONBLOCK by hal when probing the fileystem
+ type (by removing it)
-- Sjoerd Simons <sjoerd@debian.org> Mon, 18 Oct 2004 16:30:01 +0200
Added: packages/hal/trunk/debian/patches/nonblock.patch
===================================================================
--- packages/hal/trunk/debian/patches/nonblock.patch 2004-10-19 12:19:24 UTC (rev 38)
+++ packages/hal/trunk/debian/patches/nonblock.patch 2004-10-19 12:34:57 UTC (rev 39)
@@ -0,0 +1,100 @@
+Index: hald/linux/block_class_device.c
+===================================================================
+RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
+retrieving revision 1.84
+retrieving revision 1.85
+diff -u -r1.84 -r1.85
+--- hald/linux/block_class_device.c 8 Oct 2004 16:40:24 -0000 1.84
++++ hald/linux/block_class_device.c 15 Oct 2004 20:39:51 -0000 1.85
+@@ -1,5 +1,5 @@
+ /***************************************************************************
+- * CVSID: $Id: block_class_device.c,v 1.84 2004/10/08 16:40:24 david Exp $
++ * CVSID: $Id: block_class_device.c,v 1.85 2004/10/15 20:39:51 david Exp $
+ *
+ * Block device class
+ *
+@@ -911,6 +911,8 @@
+ if (fd < 0)
+ return FALSE;
+
++ close (fd);
++
+ /* Now got_media==TRUE and fd>0.. So, Yay!, we got media
+ *
+ * See if we already got children (or children underway :-),
+@@ -923,7 +925,6 @@
+ get_child_device_tdl (d);
+ }
+ if (child != NULL) {
+- close (fd);
+ return FALSE;
+ }
+
+@@ -1000,9 +1001,8 @@
+
+ HAL_INFO (("Detecting if %s contains a fs", device_file));
+
+- vid = volume_id_open_fd (fd);
++ vid = volume_id_open_node (device_file);
+ if (vid == NULL) {
+- close (fd);
+ g_object_unref (child);
+ return FALSE;
+ }
+@@ -1011,15 +1011,14 @@
+ if (is_cdrom) {
+ /* volume_id cannot probe blank/audio discs etc,
+ * so don't fail for them, just set vid to NULL */
+- volume_id_close (vid);
+ vid = NULL;
+ } else {
+- close (fd);
+ g_object_unref (child);
+ volume_id_close (vid);
+ return FALSE;
+ }
+ }
++
+ }
+
+ /* Unfortunally, linux doesn't scan optical discs for partition
+@@ -1032,7 +1031,6 @@
+ if (!no_partitions) {
+ if (vid != NULL)
+ volume_id_close (vid);
+- close (fd);
+ g_object_unref (child);
+ return FALSE;
+ }
+@@ -1072,12 +1070,11 @@
+ G_CALLBACK (class_device_move_from_tdl_to_gdl), cad);
+ hal_callout_device (child, TRUE);
+
+- volume_id_close (vid);
+- close (fd);
++ if (vid != NULL)
++ volume_id_close (vid);
+ return TRUE;
+ }
+
+- close (fd);
+ return FALSE;
+ }
+
+Index: hald/linux/volume_id/volume_id.c
+===================================================================
+RCS file: /cvs/hal/hal/hald/linux/volume_id/volume_id.c,v
+retrieving revision 1.42
+retrieving revision 1.43
+diff -u -r1.42 -r1.43
+--- hald/linux/volume_id/volume_id.c 29 Sep 2004 16:29:45 -0000 1.42
++++ hald/linux/volume_id/volume_id.c 15 Oct 2004 20:39:51 -0000 1.43
+@@ -2128,7 +2128,7 @@
+ struct volume_id *id;
+ int fd;
+
+- fd = open(path, O_RDONLY | O_NONBLOCK);
++ fd = open(path, O_RDONLY /*| O_NONBLOCK */);
+ if (fd < 0) {
+ dbg("unable to open '%s'", path);
+ return NULL;