summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-10-22 19:42:07 -0400
committerPaul Smith <psmith@gnu.org>2022-10-22 22:40:26 -0400
commitf364e0d8d6e03f1e8bc995641530e4df6598704c (patch)
treef7700f2873b0c5b1dd5dffbb741c6f5f3ce43f01 /src/job.c
parentbb0c05a7f0329dd2ea38021e9c0b9e74e0cdb7de (diff)
downloadmake-git-f364e0d8d6e03f1e8bc995641530e4df6598704c.tar.gz
Set PATH_MAX on systems without a default value
Some systems (HURD) use fully-dynamic pathnames, with no limit. We can't support this without significant effort so for now set PATH_MAX to a large value. * src/makeint.h: Set PATH_MAX to 4096 if not set and MAXPATHLEN is also not set. Remove MAXPATHLEN setting: we won't use it. * src/misc.c (get_path_max): If we can't get the path max via pathconf() use the default PATH_MAX. * src/dir.c (find_directory) [W32]: Use MAX_PATH not MAXPATHLEN. (local_stat) [W32]: Ditto. * src/job.c (create_batch_file) [W32]: Ditto. * src/remake.c (name_mtime) [W32]: Ditto. * src/w32/w32os.c (os_anontmp) [W32]: Ditto.
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/job.c b/src/job.c
index 9d381904..21492441 100644
--- a/src/job.c
+++ b/src/job.c
@@ -283,7 +283,7 @@ create_batch_file (char const *base, int unixy, int *fd)
{
const char *const ext = unixy ? "sh" : "bat";
const char *error_string = NULL;
- char temp_path[MAXPATHLEN]; /* need to know its length */
+ char temp_path[MAX_PATH+1]; /* need to know its length */
unsigned path_size = GetTempPath (sizeof temp_path, temp_path);
int path_is_dot = 0;
/* The following variable is static so we won't try to reuse a name