Skip to content

Commit ecdd746

Browse files
authored
Merge pull request #9793 from jsquyres/pr/fix-macos-build
sharedfp: use opal_basename()
2 parents 6a6ff56 + c79291e commit ecdd746

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ompi/mca/sharedfp/sm/sharedfp_sm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2021 University of Houston. All rights reserved.
1313
* Copyright (c) 2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -31,6 +32,8 @@
3132
#include "ompi/mca/sharedfp/base/base.h"
3233
#include "ompi/mca/sharedfp/sm/sharedfp_sm.h"
3334

35+
#include "opal/util/basename.h"
36+
3437
/*
3538
* *******************************************************************
3639
* ************************ actions structure ************************
@@ -97,7 +100,7 @@ struct mca_sharedfp_base_module_1_0_0_t * mca_sharedfp_sm_component_file_query(o
97100

98101

99102
/* Check that we can actually open the required file */
100-
char *filename_basename = basename((char*)fh->f_filename);
103+
char *filename_basename = opal_basename((char*)fh->f_filename);
101104
char *sm_filename;
102105
int comm_cid = -1;
103106
int pid = ompi_comm_rank (comm);

ompi/mca/sharedfp/sm/sharedfp_sm_file_open.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2013 Intel, Inc. All rights reserved.
1414
* Copyright (c) 2015-2018 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
16-
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
16+
* Copyright (c) 2015-2021 Cisco Systems, Inc. All rights reserved.
1717
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
1818
* $COPYRIGHT$
1919
*
@@ -41,6 +41,8 @@
4141
#include "ompi/mca/sharedfp/sharedfp.h"
4242
#include "ompi/mca/sharedfp/base/base.h"
4343

44+
#include "opal/util/basename.h"
45+
4446
#include <semaphore.h>
4547
#include <sys/mman.h>
4648
#include <libgen.h>
@@ -101,7 +103,7 @@ int mca_sharedfp_sm_file_open (struct ompi_communicator_t *comm,
101103
** and then mapping it to memory
102104
** For sharedfp we also want to put the file backed shared memory into the tmp directory
103105
*/
104-
filename_basename = basename((char*)filename);
106+
filename_basename = opal_basename((char*)filename);
105107
/* format is "%s/%s_cid-%d-%d.sm", see below */
106108
sm_filename_length = strlen(ompi_process_info.job_session_dir) + 1 + strlen(filename_basename) + 5 + (3*sizeof(uint32_t)+1) + 4;
107109
sm_filename = (char*) malloc( sizeof(char) * sm_filename_length);

0 commit comments

Comments
 (0)