Skip to content

Commit

Permalink
hurd: Fix build
Browse files Browse the repository at this point in the history
Use PTRE_PATH_MAX instead of PATH_MAX or MAXPATHLEN

Signed-off-by: Samuel Thibault <[email protected]>
  • Loading branch information
sthibaul committed Jan 28, 2025
1 parent 8ecee64 commit 3355aca
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/mca/common/alps/common_alps.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int prte_common_alps_proc_in_pagg(bool *flag)
int rc = PRTE_SUCCESS;
const char proc_job_file[] = "/proc/job";
FILE *fd = NULL, *fd_task_is_app = NULL;
char task_is_app_fname[PATH_MAX];
char task_is_app_fname[PRTE_PATH_MAX];

if (flag == NULL) {
return PRTE_ERR_BAD_PARAM;
Expand Down
4 changes: 2 additions & 2 deletions src/mca/ess/base/ess_base_std_prted.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int prte_ess_base_prted_setup(void)
{
int ret = PRTE_ERROR;
int fd;
char log_file[PATH_MAX];
char log_file[PRTE_PATH_MAX];
char *error = NULL;
char *tmp = NULL;
prte_job_t *jdata = NULL;
Expand Down Expand Up @@ -269,7 +269,7 @@ int prte_ess_base_prted_setup(void)
*/

/* define a log file name in the session directory */
snprintf(log_file, PATH_MAX, "output-prted-%s-%s.log",
snprintf(log_file, PRTE_PATH_MAX, "output-prted-%s-%s.log",
prte_process_info.myproc.nspace,
prte_process_info.nodename);
log_path = pmix_os_path(false, prte_process_info.top_session_dir, log_file, NULL);
Expand Down
4 changes: 2 additions & 2 deletions src/mca/filem/raw/filem_raw_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ static int link_archive(prte_filem_raw_incoming_t *inbnd)
{
FILE *fp;
char *cmd;
char path[MAXPATHLEN];
char path[PRTE_PATH_MAX];

PMIX_OUTPUT_VERBOSE((1, prte_filem_base_framework.framework_output,
"%s filem:raw: identifying links for archive %s",
Expand Down Expand Up @@ -1060,7 +1060,7 @@ static void write_handler(int fd, short event, void *cbdata)
prte_filem_raw_output_t *output;
int num_written;
char *dirname, *cmd;
char homedir[MAXPATHLEN];
char homedir[PRTE_PATH_MAX];
int rc;
PRTE_HIDE_UNUSED_PARAMS(fd, event);

Expand Down
6 changes: 3 additions & 3 deletions src/mca/odls/base/odls_base_default_fns.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ int prte_odls_base_default_construct_child_list(pmix_data_buffer_t *buffer, pmix
static int setup_path(prte_app_context_t *app, char **wdir)
{
int rc = PRTE_SUCCESS;
char dir[MAXPATHLEN];
char dir[PRTE_PATH_MAX];
char *session_dir;
bool usercwd = false;
prte_job_t *job;
Expand Down Expand Up @@ -1124,7 +1124,7 @@ void prte_odls_base_default_launch_local(int fd, short sd, void *cbdata)
prte_app_context_t *app;
prte_proc_t *child = NULL;
int rc = PRTE_SUCCESS;
char basedir[MAXPATHLEN];
char basedir[PRTE_PATH_MAX];
int j, idx;
int total_num_local_procs = 0;
prte_odls_launch_local_t *caddy = (prte_odls_launch_local_t *) cbdata;
Expand Down Expand Up @@ -1979,7 +1979,7 @@ int prte_odls_base_default_restart_proc(prte_proc_t *child,
int rc;
prte_app_context_t *app;
prte_job_t *jobdat;
char basedir[MAXPATHLEN];
char basedir[PRTE_PATH_MAX];
char *wdir = NULL;
prte_odls_spawn_caddy_t *cd;
prte_event_base_t *evb;
Expand Down
2 changes: 1 addition & 1 deletion src/mca/odls/default/odls_default_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static void do_child(prte_odls_spawn_caddy_t *cd, int write_fd)
{
int i;
sigset_t sigs;
char dir[MAXPATHLEN];
char dir[PRTE_PATH_MAX];

#if HAVE_SETPGID
/* Set a new process group for this child, so that any
Expand Down
6 changes: 3 additions & 3 deletions src/mca/ras/alps/ras_alps_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static int parser_ini(char **val_if_found, FILE *fp, const char *var_name)
return PRTE_ERR_FILE_OPEN_FAILURE;
}
*cpr = '\0';
if (strlen(cpq) + 8 > PATH_MAX) { /* Bad configuration */
if (strlen(cpq) + 8 > PRTE_PATH_MAX) { /* Bad configuration */
free(alps_config_str);
PRTE_ERROR_LOG(PRTE_ERR_FILE_OPEN_FAILURE);
return PRTE_ERR_FILE_OPEN_FAILURE;
Expand Down Expand Up @@ -203,7 +203,7 @@ static int parser_separated_columns(char **val_if_found, FILE *fp, const char *v
}
*cpr = '\0';
/* Bad configuration sanity check */
if (strlen(cpq) + 8 > PATH_MAX) {
if (strlen(cpq) + 8 > PRTE_PATH_MAX) {
free(alps_config_str);
PRTE_ERROR_LOG(PRTE_ERR_FILE_OPEN_FAILURE);
return PRTE_ERR_FILE_OPEN_FAILURE;
Expand Down Expand Up @@ -340,7 +340,7 @@ static int prte_ras_alps_allocate(prte_job_t *jdata, pmix_list_t *nodes)
return ret;
}

#define RAS_BASE_FILE_MAX_LINE_LENGTH (PATH_MAX * 2)
#define RAS_BASE_FILE_MAX_LINE_LENGTH (PRTE_PATH_MAX * 2)

static char *ras_alps_getline(FILE *fp)
{
Expand Down

0 comments on commit 3355aca

Please sign in to comment.