Skip to content

Commit

Permalink
Never use PATH_MAX directly.
Browse files Browse the repository at this point in the history
Instead rely on OPAL_PATH_MAX #define. This complements the fix for #12108

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
(cherry picked from commit e051834)
  • Loading branch information
bosilca committed Jan 23, 2024
1 parent 34506e0 commit 08f21fd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions opal/mca/btl/smcuda/btl_smcuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2017 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014-2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -471,7 +471,7 @@ static struct mca_btl_base_endpoint_t *create_sm_endpoint(int local_proc, struct
struct mca_btl_base_endpoint_t *ep;

#if OPAL_ENABLE_PROGRESS_THREADS == 1
char path[PATH_MAX];
char path[OPAL_PATH_MAX];
#endif

ep = (struct mca_btl_base_endpoint_t *) malloc(sizeof(struct mca_btl_base_endpoint_t));
Expand Down
4 changes: 2 additions & 2 deletions opal/mca/btl/smcuda/btl_smcuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Copyright (c) 2009-2010 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2010-2015 Los Alamos National Security, LLC.
* All rights reserved.
* Copyright (c) 2012-2013 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2012-2023 NVIDIA Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -164,7 +164,7 @@ struct mca_btl_smcuda_component_t {
int num_mem_nodes;

#if OPAL_ENABLE_PROGRESS_THREADS == 1
char sm_fifo_path[PATH_MAX]; /**< path to fifo used to signal this process */
char sm_fifo_path[OPAL_PATH_MAX]; /**< path to fifo used to signal this process */
int sm_fifo_fd; /**< file descriptor corresponding to opened fifo */
opal_thread_t sm_fifo_thread;
#endif
Expand Down
3 changes: 2 additions & 1 deletion opal/mca/btl/usnic/btl_usnic_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2013-2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -245,7 +246,7 @@ void opal_btl_usnic_connectivity_map(void)

fp = fopen(filename, "w");
if (NULL == fp) {
char dirname[PATH_MAX];
char dirname[OPAL_PATH_MAX];
getcwd(dirname, sizeof(dirname));
dirname[sizeof(dirname) - 1] = '\0';
opal_show_help("help-mpi-btl-usnic.txt", "cannot write to map file", true,
Expand Down
5 changes: 3 additions & 2 deletions opal/mca/common/ucx/common_ucx.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* reserved.
* Copyright (c) 2022 Google, LLC. All rights reserved.
* Copyright (c) 2022 IBM Corporation. All rights reserved.
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
*
* $COPYRIGHT$
*
Expand Down Expand Up @@ -182,8 +183,8 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
#if HAVE_DECL_OPEN_MEMSTREAM
static bool opal_common_ucx_check_device(const char *device_name, char **device_list)
{
char sysfs_driver_link[PATH_MAX];
char driver_path[PATH_MAX];
char sysfs_driver_link[OPAL_PATH_MAX];
char driver_path[OPAL_PATH_MAX];
char ib_device_name[NAME_MAX];
char *driver_name;
char **list_item;
Expand Down
5 changes: 3 additions & 2 deletions oshmem/mca/memheap/base/memheap_base_static.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2013 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* Copyright (c) 2023 NVIDIA Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -165,8 +166,8 @@ static int _check_pathname(uint64_t inode, const char *pathname)
{
static const char *proc_self_exe = "/proc/self/exe";
static int warned = 0;
char exe_path[PATH_MAX];
char module_path[PATH_MAX];
char exe_path[OPAL_PATH_MAX];
char module_path[OPAL_PATH_MAX];
char *path;

if (0 == inode) {
Expand Down

0 comments on commit 08f21fd

Please sign in to comment.