diff options
author | Rob Johnston <rob.johnston@joyent.com> | 2019-03-01 02:53:56 +0000 |
---|---|---|
committer | Rob Johnston <rob.johnston@joyent.com> | 2019-03-01 02:53:56 +0000 |
commit | e1c0eca8177319e39c48a453acaf2858b9d6df2e (patch) | |
tree | 0f3bedf47772e4104ed88d272f2a8d1a58518940 | |
parent | 82fef5628b8daadbccf04d7cef97e362ef68b61d (diff) | |
download | illumos-joyent-e1c0eca8177319e39c48a453acaf2858b9d6df2e.tar.gz |
Update topo_mod_load() to load the correct plugin version based on the process isatopo64
-rw-r--r-- | usr/src/lib/fm/topo/libtopo/common/topo_mod.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/src/lib/fm/topo/libtopo/common/topo_mod.c b/usr/src/lib/fm/topo/libtopo/common/topo_mod.c index cecb147f21..76f733c2ec 100644 --- a/usr/src/lib/fm/topo/libtopo/common/topo_mod.c +++ b/usr/src/lib/fm/topo/libtopo/common/topo_mod.c @@ -93,6 +93,7 @@ #include <ctype.h> #include <pcidb.h> #include <sys/param.h> +#include <sys/systeminfo.h> #include <sys/utsname.h> #include <sys/smbios.h> #include <sys/fm/protocol.h> @@ -117,7 +118,7 @@ topo_mod_t * topo_mod_load(topo_mod_t *pmod, const char *name, topo_version_t version) { - char *path; + char *path, isa[257]; char file[PLUGIN_PATH_LEN]; topo_mod_t *mod = NULL; topo_hdl_t *thp; @@ -135,9 +136,14 @@ topo_mod_load(topo_mod_t *pmod, const char *name, } return (mod); } - - (void) snprintf(file, PLUGIN_PATH_LEN, "%s/%s.so", - PLUGIN_PATH, name); +#if __x86_64__ + if (sysinfo(SI_ARCHITECTURE_64, isa, sizeof (isa)) < 0) + isa[0] = '\0'; +#else + isa[0] = '\0'; +#endif + (void) snprintf(file, PLUGIN_PATH_LEN, "%s/%s/%s.so", + PLUGIN_PATH, isa, name); path = topo_search_path(pmod, thp->th_rootdir, (const char *)file); if (path == NULL || (mod = topo_modhash_load(thp, name, path, &topo_rtld_ops, version)) |