Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions opal/mca/dl/dlopen/dl_dlopen_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -32,7 +33,6 @@
static void do_dlopen(const char *fname, int flags,
void **handle, char **err_msg)
{
assert(fname);
assert(handle);

*handle = dlopen(fname, flags);
Expand All @@ -50,7 +50,6 @@ static void do_dlopen(const char *fname, int flags,
static int dlopen_open(const char *fname, bool use_ext, bool private_namespace,
opal_dl_handle_t **handle, char **err_msg)
{
assert(fname);
assert(handle);

*handle = NULL;
Expand All @@ -66,7 +65,7 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace,
/* If the caller wants to use filename extensions, loop through
them */
void *local_handle = NULL;
if (use_ext) {
if (use_ext && NULL != fname) {
int i;
char *ext;

Expand Down Expand Up @@ -109,7 +108,12 @@ static int dlopen_open(const char *fname, bool use_ext, bool private_namespace,
(*handle)->dlopen_handle = local_handle;

#if OPAL_ENABLE_DEBUG
(*handle)->filename = strdup(fname);
if( NULL != fname ) {
(*handle)->filename = strdup(fname);
}
else {
(*handle)->filename = strdup("(null)");
}
#endif
}
return (NULL != local_handle) ? OPAL_SUCCESS : OPAL_ERROR;
Expand Down
9 changes: 7 additions & 2 deletions opal/mca/dl/libltdl/dl_libltdl_module.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -18,7 +19,6 @@
static int libltdl_open(const char *fname, bool use_ext, bool private_namespace,
opal_dl_handle_t **handle, char **err_msg)
{
assert(fname);
assert(handle);

*handle = NULL;
Expand Down Expand Up @@ -53,7 +53,12 @@ static int libltdl_open(const char *fname, bool use_ext, bool private_namespace,
(*handle)->ltdl_handle = local_handle;

#if OPAL_ENABLE_DEBUG
(*handle)->filename = strdup(fname);
if( NULL != fname ) {
(*handle)->filename = strdup(fname);
}
else {
(*handle)->filename = strdup("(null)");
}
#endif

return OPAL_SUCCESS;
Expand Down