Skip to content

Commit e051834

Browse files
committed
Never use PATH_MAX directly.
Instead rely on OPAL_PATH_MAX #define. This complements the fix for #12108 Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent fbea826 commit e051834

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

opal/mca/btl/smcuda/btl_smcuda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2010-2017 Los Alamos National Security, LLC. All rights
1616
* reserved.
17-
* Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved.
17+
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
1818
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1919
* Copyright (c) 2014-2017 Research Organization for Information Science
2020
* and Technology (RIST). All rights reserved.
@@ -471,7 +471,7 @@ static struct mca_btl_base_endpoint_t *create_sm_endpoint(int local_proc, struct
471471
struct mca_btl_base_endpoint_t *ep;
472472

473473
#if OPAL_ENABLE_PROGRESS_THREADS == 1
474-
char path[PATH_MAX];
474+
char path[OPAL_PATH_MAX];
475475
#endif
476476

477477
ep = (struct mca_btl_base_endpoint_t *) malloc(sizeof(struct mca_btl_base_endpoint_t));

opal/mca/btl/smcuda/btl_smcuda.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
1616
* All rights reserved.
17-
* Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved.
17+
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
1818
* $COPYRIGHT$
1919
*
2020
* Additional copyrights may follow
@@ -164,7 +164,7 @@ struct mca_btl_smcuda_component_t {
164164
int num_mem_nodes;
165165

166166
#if OPAL_ENABLE_PROGRESS_THREADS == 1
167-
char sm_fifo_path[PATH_MAX]; /**< path to fifo used to signal this process */
167+
char sm_fifo_path[OPAL_PATH_MAX]; /**< path to fifo used to signal this process */
168168
int sm_fifo_fd; /**< file descriptor corresponding to opened fifo */
169169
opal_thread_t sm_fifo_thread;
170170
#endif

opal/mca/btl/usnic/btl_usnic_map.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
33
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
44
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
5+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -245,7 +246,7 @@ void opal_btl_usnic_connectivity_map(void)
245246

246247
fp = fopen(filename, "w");
247248
if (NULL == fp) {
248-
char dirname[PATH_MAX];
249+
char dirname[OPAL_PATH_MAX];
249250
getcwd(dirname, sizeof(dirname));
250251
dirname[sizeof(dirname) - 1] = '\0';
251252
opal_show_help("help-mpi-btl-usnic.txt", "cannot write to map file", true,

opal/mca/common/ucx/common_ucx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* reserved.
99
* Copyright (c) 2022 Google, LLC. All rights reserved.
1010
* Copyright (c) 2022 IBM Corporation. All rights reserved.
11+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
1112
*
1213
* $COPYRIGHT$
1314
*
@@ -182,8 +183,8 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
182183
#if HAVE_DECL_OPEN_MEMSTREAM
183184
static bool opal_common_ucx_check_device(const char *device_name, char **device_list)
184185
{
185-
char sysfs_driver_link[PATH_MAX];
186-
char driver_path[PATH_MAX];
186+
char sysfs_driver_link[OPAL_PATH_MAX];
187+
char driver_path[OPAL_PATH_MAX];
187188
char ib_device_name[NAME_MAX];
188189
char *driver_name;
189190
char **list_item;

oshmem/mca/memheap/base/memheap_base_static.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright (c) 2013 Mellanox Technologies, Inc.
33
* All rights reserved.
44
* Copyright (c) 2016 IBM Corporation. All rights reserved.
5+
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -165,8 +166,8 @@ static int _check_pathname(uint64_t inode, const char *pathname)
165166
{
166167
static const char *proc_self_exe = "/proc/self/exe";
167168
static int warned = 0;
168-
char exe_path[PATH_MAX];
169-
char module_path[PATH_MAX];
169+
char exe_path[OPAL_PATH_MAX];
170+
char module_path[OPAL_PATH_MAX];
170171
char *path;
171172

172173
if (0 == inode) {

0 commit comments

Comments
 (0)