Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > 26764e702e441b473525f6a16ac25557 > files > 23

hal-0.5.8.1-59.el5.src.rpm

From: David Zeuthen <davidz@redhat.com>
Date: Tue, 26 Sep 2006 19:50:51 +0000 (-0400)
Subject: don't crash on cd drives without write capabilities
X-Git-Tag: HAL_0_2
X-Git-Url: http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=c127f54ee1a91743989ccdbe93025740fe9cec73

don't crash on cd drives without write capabilities

This fix needs to be forward-ported to master. Probably we shouldn't
be looking for write speeds unless the drive can write. This fix
will do it for the 0.5.8 series though.
---

--- a/hald/linux/probing/probe-storage.c
+++ b/hald/linux/probing/probe-storage.c
@@ -254,8 +254,10 @@ main (int argc, char *argv[])
 						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);
 				}
 			}