If we have a valid UID but it's a null string, display '<null>' rather than

nothing at all.
This commit is contained in:
jmcneill 2002-12-31 05:59:53 +00:00
parent 0c77fcf312
commit 3893537d91
1 changed files with 10 additions and 4 deletions

View File

@ -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. * Copyright 2001 Wasabi Systems, Inc.
@ -41,7 +41,7 @@
*/ */
#include <sys/cdefs.h> #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/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -553,6 +553,7 @@ int
acpi_print(void *aux, const char *pnp) acpi_print(void *aux, const char *pnp)
{ {
struct acpi_attach_args *aa = aux; struct acpi_attach_args *aa = aux;
char *uid;
#if 0 #if 0
char *str; char *str;
#endif #endif
@ -569,8 +570,13 @@ acpi_print(void *aux, const char *pnp)
printf("at %s", pnp); printf("at %s", pnp);
} else { } else {
printf(" (%s", aa->aa_node->ad_devinfo.HardwareId); printf(" (%s", aa->aa_node->ad_devinfo.HardwareId);
if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_UID) if (aa->aa_node->ad_devinfo.Valid & ACPI_VALID_UID) {
printf("-%s", aa->aa_node->ad_devinfo.UniqueId); if (aa->aa_node->ad_devinfo.UniqueId[0] == '\0')
uid = "<null>";
else
uid = aa->aa_node->ad_devinfo.UniqueId;
printf("-%s", uid);
}
printf(")"); printf(")");
} }