]> git.pld-linux.org Git - packages/hal.git/commitdiff
- patches from fedora/included in GIT
authoraflinta <aflinta@pld-linux.org>
Sun, 4 Mar 2007 19:50:39 +0000 (19:50 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    hal-dont-crash-on-cdrom-drives.patch -> 1.1
    hal-stat-devicefile-not-mountpoint.patch -> 1.1

hal-dont-crash-on-cdrom-drives.patch [new file with mode: 0644]
hal-stat-devicefile-not-mountpoint.patch [new file with mode: 0644]

diff --git a/hal-dont-crash-on-cdrom-drives.patch b/hal-dont-crash-on-cdrom-drives.patch
new file mode 100644 (file)
index 0000000..feba731
--- /dev/null
@@ -0,0 +1,15 @@
+diff -urN hal-0.5.8.1.orig/hald/linux/probing/probe-storage.c hal-0.5.8.1/hald/linux/probing/probe-storage.c
+--- hal-0.5.8.1.orig/hald/linux/probing/probe-storage.c        2007-03-04 18:57:02.987765366 +0100
++++ hal-0.5.8.1/hald/linux/probing/probe-storage.c     2007-03-04 19:00:20.347534611 +0100
+@@ -254,8 +254,10 @@
+                                               free (write_speeds);
+                                       }
+                               } else {
++                                      gchar *wspeeds[1] = {NULL};
+                                       libhal_changeset_set_property_int (cs, "storage.cdrom.write_speed", 0);
+-                                      libhal_changeset_set_property_strlist (cs, "storage.cdrom.write_speeds", NULL);
++                                      libhal_changeset_set_property_strlist (cs, "storage.cdrom.write_speeds", 
++                                                                                  (const char **) wspeeds);
+                               }
+                       }
+                       
diff --git a/hal-stat-devicefile-not-mountpoint.patch b/hal-stat-devicefile-not-mountpoint.patch
new file mode 100644 (file)
index 0000000..3103157
--- /dev/null
@@ -0,0 +1,83 @@
+diff -urN hal-0.5.8.1.orig/hald/linux/blockdev.c hal-0.5.8.1/hald/linux/blockdev.c
+--- hal-0.5.8.1.orig/hald/linux/blockdev.c     2007-03-04 18:57:02.977766053 +0100
++++ hal-0.5.8.1/hald/linux/blockdev.c  2007-03-04 19:06:43.197888845 +0100
+@@ -168,7 +168,6 @@
+       dev_t devt = makedev(0, 0);
+       GSList *volumes = NULL;
+       GSList *volume;
+-        GSList *autofs_mounts = NULL;
+       /* open /proc/mounts */
+       g_snprintf (buf, sizeof (buf), "%s/mounts", get_hal_proc_path ());
+@@ -189,6 +188,8 @@
+       while ((mnte = getmntent_r (f, &mnt, buf, sizeof(buf))) != NULL) {
+               struct stat statbuf;
++              /*HAL_INFO ((" * /proc/mounts contain dev %s - type %s", mnt.mnt_fsname, mnt.mnt_type));*/
++
+               /* If this is a nfs mount (fstype == 'nfs') ignore the mount. Reason:
+                *  1. we don't list nfs devices in HAL
+                *  2. more problematic: stat on mountpoints with 'stale nfs handle' never come
+@@ -197,35 +198,14 @@
+               if (strcmp(mnt.mnt_type, "nfs") == 0)
+                       continue;
+-              /* If this is an autofs mount (fstype == 'autofs') 
+-               * store the mount in a list for later use. 
+-               * On mounts managed by autofs accessing files below the mount
+-               * point cause the mount point to be remounted after an 
+-               * unmount.  We keep the list so we do not check for
+-               * the .created-by-hal file on mounts under autofs mount points
+-               */
+-              if (strcmp(mnt.mnt_type, "autofs") == 0) {
+-                      char *mnt_dir;
+-
+-                      if (mnt.mnt_dir[strlen (mnt.mnt_dir) - 1] != '/')
+-                              mnt_dir = g_strdup_printf ("%s/", mnt.mnt_dir);
+-                      else
+-                              mnt_dir = g_strdup (mnt.mnt_dir);
+-
+-                      autofs_mounts = g_slist_append (autofs_mounts,
+-                                                      mnt_dir);
+-
+-
++              /* get major:minor of special device file */
++              if (stat (mnt.mnt_fsname, &statbuf) != 0)
+                       continue;
+-              }
+-              /* check the underlying device of the mount point */
+-              if (stat (mnt.mnt_dir, &statbuf) != 0)
+-                      continue;
+-              if (major(statbuf.st_dev) == 0)
++              if (major (statbuf.st_rdev) == 0)
+                       continue;
+-              /*HAL_INFO (("* found mounts dev %s (%i:%i)", mnt.mnt_fsname, major(statbuf.st_dev), minor(statbuf.st_dev)));*/
++              /*HAL_INFO (("* found mounts dev %s (%i:%i)", mnt.mnt_fsname, major (statbuf.st_rdev), minor (statbuf.st_rdev)));*/
+               /* match against all hal volumes */
+               for (volume = volumes; volume != NULL; volume = g_slist_next (volume)) {
+                       HalDevice *dev;
+@@ -235,10 +215,10 @@
+                       if (major == 0)
+                               continue;
+                       minor = hal_device_property_get_int (dev, "block.minor");
+-                      devt = makedev(major, minor);
++                      devt = makedev (major, minor);
+                       /*HAL_INFO (("  match %s (%i:%i)", hal_device_get_udi (dev), major, minor));*/
+-                      if (statbuf.st_dev == devt) {
++                      if (statbuf.st_rdev == devt) {
+                               /* found entry for this device in /proc/mounts */
+                               device_property_atomic_update_begin ();
+                               hal_device_property_set_bool (dev, "volume.is_mounted", TRUE);
+@@ -255,9 +235,6 @@
+               }
+       }
+-      g_slist_foreach (autofs_mounts, (GFunc) g_free, NULL);
+-      g_slist_free (autofs_mounts);
+-
+       /* all remaining volumes are not mounted */
+       for (volume = volumes; volume != NULL; volume = g_slist_next (volume)) {
+               HalDevice *dev;
This page took 0.045731 seconds and 4 git commands to generate.