Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi If we have a valid UID but it's a null string, ...



details:   https://anonhg.NetBSD.org/src/rev/6721ad2cd632
branches:  trunk
changeset: 541020:6721ad2cd632
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Dec 31 05:59:53 2002 +0000

description:
If we have a valid UID but it's a null string, display '<null>' rather than
nothing at all.

diffstat:

 sys/dev/acpi/acpi.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r ec41912419fb -r 6721ad2cd632 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Tue Dec 31 05:27:29 2002 +0000
+++ b/sys/dev/acpi/acpi.c       Tue Dec 31 05:59:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.21 2002/12/30 09:33:25 matt Exp $   */
+/*     $NetBSD: acpi.c,v 1.22 2002/12/31 05:59:53 jmcneill Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.21 2002/12/30 09:33:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.22 2002/12/31 05:59:53 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -553,6 +553,7 @@
 acpi_print(void *aux, const char *pnp)
 {
        struct acpi_attach_args *aa = aux;
+       char *uid;
 #if 0
        char *str;
 #endif
@@ -569,8 +570,13 @@
                printf("at %s", pnp);
        } else {
                printf(" (%s", aa->aa_node->ad_devinfo.HardwareId);
-               if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_UID)
-                       printf("-%s", aa->aa_node->ad_devinfo.UniqueId);
+               if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_UID) {
+                       if (aa->aa_node->ad_devinfo.UniqueId[0] == '\0')
+                               uid = "<null>";
+                       else
+                               uid = aa->aa_node->ad_devinfo.UniqueId;
+                       printf("-%s", uid);
+               }
                printf(")");
        }
 



Home | Main Index | Thread Index | Old Index