Mercurial > illumos > fmac
changeset 6201:8c4c42921dd1 onnv_86
6604160 On non supported platform prtfru/fruadm commands give misleading message output.
author | dt207653 |
---|---|
date | Mon, 17 Mar 2008 21:39:43 -0700 |
parents | 4d23516b872a |
children | 919831b7771a |
files | usr/src/cmd/fruadm/fruadm.c usr/src/cmd/prtfru/prtfru.c |
diffstat | 2 files changed, 11 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/fruadm/fruadm.c Mon Mar 17 20:29:32 2008 -0700 +++ b/usr/src/cmd/fruadm/fruadm.c Mon Mar 17 21:39:43 2008 -0700 @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -856,25 +856,6 @@ exit(1); } -static int -has_system_controller() -{ - char platform[PATH_MAX]; - - int size; - - if (((size = sysinfo(SI_PLATFORM, platform, sizeof (platform))) - < 0) || (size > sizeof (platform))) - return (-1); - - if ((strcmp("SUNW,Sun-Fire", platform) == 0) || - (strcmp("SUNW,Sun-Fire-15000", platform) == 0)) { - return (1); - } - - return (0); -} - int main(int argc, char *argv[]) { @@ -960,16 +941,11 @@ } if ((status = fru_get_root(&root)) == FRU_NODENOTFOUND) { - if (has_system_controller() == 1) { - (void) fprintf(stderr, - gettext("Access FRUs from the " - "System Controller\n")); - } else { - (void) fprintf(stderr, - gettext("This system does not provide " - "FRU ID data\n")); - - } + (void) fprintf(stderr, + gettext("This system does not support PICL " + "infrastructure to provide FRUID data\n" + "Please use the platform SP to access the FRUID " + "information\n")); return (1); } else if (status != FRU_SUCCESS) { (void) fprintf(stderr,
--- a/usr/src/cmd/prtfru/prtfru.c Mon Mar 17 20:29:32 2008 -0700 +++ b/usr/src/cmd/prtfru/prtfru.c Mon Mar 17 21:39:43 2008 -0700 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1207,7 +1207,10 @@ /* Get the root node */ if ((status = fru_get_root(&frutree)) == FRU_NODENOTFOUND) { - error(gettext("This system does not provide FRU ID data\n")); + error(gettext("This system does not support PICL " + "infrastructure to provide FRUID data\n" + "Please use the platform SP to access the FRUID " + "information\n")); return (1); } else if (status != FRU_SUCCESS) { error(gettext("Unable to access FRU ID data: %s\n"),