diff options
author | dnielsen <none@none> | 2006-05-09 15:15:24 -0700 |
---|---|---|
committer | dnielsen <none@none> | 2006-05-09 15:15:24 -0700 |
commit | 09fe1b16b0d85a4b43987628152f516df3ae9838 (patch) | |
tree | 90ae407b6e9117515abec57ef5ee1ccde6b9ea01 /usr/src/lib/libcfgadm | |
parent | e39279ef024a363f4fa0b317e05bef952f4dcfb8 (diff) | |
download | illumos-gate-09fe1b16b0d85a4b43987628152f516df3ae9838.tar.gz |
PSARC 2006/233 OPL hddlocator
6374522 Need a Solaris command to control hard disk LEDs
Diffstat (limited to 'usr/src/lib/libcfgadm')
-rw-r--r-- | usr/src/lib/libcfgadm/common/config_admin.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/usr/src/lib/libcfgadm/common/config_admin.c b/usr/src/lib/libcfgadm/common/config_admin.c index f71d220ab9..9aa33d790c 100644 --- a/usr/src/lib/libcfgadm/common/config_admin.c +++ b/usr/src/lib/libcfgadm/common/config_admin.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -23,7 +22,7 @@ /* Portions Copyright 2005 Cyril Plisko */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1535,6 +1534,7 @@ find_lib( char name[NUM_LIB_NAMES][MAXPATHLEN]; struct stat lib_stat; void *dlhandle = NULL; + static char plat_name[SYSINFO_LENGTH]; static char machine_name[SYSINFO_LENGTH]; static char arch_name[SYSINFO_LENGTH]; int i = 0; @@ -1548,12 +1548,15 @@ find_lib( * Initialize machine name and arch name */ if (strncmp("", machine_name, MAXPATHLEN) == 0) { - if (sysinfo(SI_MACHINE, machine_name, SYSINFO_LENGTH) == -1) { + if (sysinfo(SI_PLATFORM, plat_name, SYSINFO_LENGTH) == -1) { return (CFGA_ERROR); } if (sysinfo(SI_ARCHITECTURE, arch_name, SYSINFO_LENGTH) == -1) { return (CFGA_ERROR); } + if (sysinfo(SI_MACHINE, machine_name, SYSINFO_LENGTH) == -1) { + return (CFGA_ERROR); + } } /* @@ -1582,6 +1585,21 @@ find_lib( } /* + * Try path based upon platform name + */ + (void) snprintf(lib, sizeof (lib), "%s%s%s%s%s", + LIB_PATH_BASE1, plat_name, LIB_PATH_MIDDLE, + name[i], LIB_PATH_TAIL); + + if (stat(lib, &lib_stat) == 0) { + /* file exists, is it a lib */ + dlhandle = dlopen(lib, RTLD_LAZY); + if (dlhandle != NULL) { + goto found; + } + } + + /* * Try path based upon machine name */ (void) snprintf(lib, sizeof (lib), "%s%s%s%s%s", |