diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-16 18:33:43 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-16 18:33:43 +0000 |
commit | 77227d5d7217b26f18b92c9bf3f76bba6c59a956 (patch) | |
tree | 9c0989e5a2d0ad82758c164262b56cae38f4cb29 | |
parent | 792a7af405f1bcd074df2d192736f0ff71180ce6 (diff) |
Turns out getpropstring() returns an empty string if a property is missing
instead of NULL. Makes rtc(4) really work on the u25.
tested by mikeb@
-rw-r--r-- | sys/arch/sparc64/dev/rtc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sparc64/dev/rtc.c b/sys/arch/sparc64/dev/rtc.c index de1cd0052c6..2e2cec4e96c 100644 --- a/sys/arch/sparc64/dev/rtc.c +++ b/sys/arch/sparc64/dev/rtc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtc.c,v 1.5 2008/04/15 20:57:32 kettenis Exp $ */ +/* $OpenBSD: rtc.c,v 1.6 2008/04/16 18:33:42 kettenis Exp $ */ /* * Copyright (c) 1992, 1993 @@ -155,9 +155,9 @@ rtc_attach(struct device *parent, struct device *self, void *aux) } model = getpropstring(ea->ea_node, "model"); - if (model == NULL) + if (*model == '\0') model = getpropstring(ea->ea_node, "compatible"); - printf(": %s\n", model ? model : "unknown"); + printf(": %s\n", *model != '\0' != 0 ? model : "unknown"); /* Setup our todr_handle */ handle = malloc(sizeof(struct todr_chip_handle), M_DEVBUF, M_NOWAIT); |