hal: Branch 'hal-0_5_11-branch' - 3 commits

Danny Kukawka dkukawka at kemper.freedesktop.org
Fri Apr 4 04:55:23 PDT 2008


 doc/spec/hal-spec-properties.xml |    2 +-
 hald/hald_runner.c               |    2 +-
 tools/hal-disable-polling.c      |    8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 64ed8be5c2d0ddf44191ee8f951353b941052c9d
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri Apr 4 13:42:07 2008 +0200

    fixed check for return value of uname()
    
    Fixed check for return value of uname() as pointed out by Phi Tran
    <Phi.Tran at sun.com> on the HAL mailing list:
    
    > hald_runner.c line 513 uses uname and checks for the return value
    > equal to zero as success.  On Solaris, uname returns >= 0 on success.

diff --git a/hald/hald_runner.c b/hald/hald_runner.c
index f74dea1..400c90b 100644
--- a/hald/hald_runner.c
+++ b/hald/hald_runner.c
@@ -510,7 +510,7 @@ add_basic_env (DBusMessageIter * iter, const gchar * udi)
 	}
 #endif /* HAVE_CONKIT */
 
-	if (uname (&un) == 0) {
+	if (uname (&un) >= 0) {
 		char *sysname;
 
 		sysname = g_ascii_strdown (un.sysname, -1);
commit 60eab64171046caaf60c321e91f3c0681bca9fb6
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri Apr 4 13:34:56 2008 +0200

    fixed SPEC: s/alsa.device_pcm_class/alsa.pcm_class/
    
    Fixed SPEC: replaced property alsa.device_pcm_class with alsa.pcm_class
    which was used since Nov. 2006 in the code. Since I couldn't find any
    code which try to use alsa.device_pcm_class I replace it with the key
    from the code.

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index f18e183..f0718b0 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -5596,7 +5596,7 @@ org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'}
             </row>
             <row>
               <entry>
-                <literal>alsa.device_pcm_class</literal> (string)
+                <literal>alsa.pcm_class</literal> (string)
               </entry>
               <entry></entry>
               <entry>No</entry>
commit f60d1c974b575f12029ba3928f6e3c7a69dbbb8b
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri Apr 4 13:20:00 2008 +0200

    fixed usage of realpath()
    
    Fixed usage of realpath() reported via fd.o bug #15275.
    
    From the report:
    > gives a bus error on darwin. The invocation of realpath() where the second
    > parameter is NULL is a glibc extension, not part of the standard function.

diff --git a/tools/hal-disable-polling.c b/tools/hal-disable-polling.c
index 20bcd49..83c770a 100644
--- a/tools/hal-disable-polling.c
+++ b/tools/hal-disable-polling.c
@@ -79,7 +79,7 @@ int
 main (int argc, char *argv[])
 {
 	char *udi = NULL;
-	char *device = NULL, *real_device;
+	char *device = NULL;
         dbus_bool_t is_version = FALSE;
         dbus_bool_t enable_polling = FALSE;
 	DBusError error;
@@ -182,8 +182,9 @@ main (int argc, char *argv[])
 
                 devices = libhal_manager_find_device_string_match (hal_ctx, "block.device", device, &num_devices, NULL);
 		if (devices == NULL || devices[0] == NULL) {
-                        real_device = realpath(device, NULL);
-                        if (real_device == NULL) {
+			char real_device[PATH_MAX];
+
+			if (realpath(device, real_device) == NULL) {
                                 fprintf (stderr, "Cannot find device %s.\n", device);
                                 return 1;
                         }
@@ -197,7 +198,6 @@ main (int argc, char *argv[])
                         }
 
                         fprintf (stderr, "Following symlink from %s to %s.\n", device, real_device);
-			free(real_device);
                 }
 
                 for (n = 0; devices[n] != NULL; n++) {


More information about the hal-commit mailing list