]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Make sure PATH_MAX exists in debuginfod-client.c
authorMark Wielaard <mark@klomp.org>
Thu, 26 Mar 2026 12:32:18 +0000 (13:32 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 26 Mar 2026 12:32:18 +0000 (13:32 +0100)
Some systems (Hurd) don't define PATH_MAX (which is optional according
to POSIX). Make sure it is defined and no special linux specific
headers are used in debuginfod-client.c.

* debuginfod/debuginfod-client.c: Include limits.h instead of
linux/limits. If PATH_MAX isn't define it to 4K (the default
on GNU/Linux).

https://sourceware.org/bugzilla/show_bug.cgi?id=34016

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/debuginfod-client.c

index 659d6f91eb1d0dbfcf6025b1b596c6fcbe7fd42a..fb9ad82f7f5d32ab4cf15dc33e89132ad41c774b 100644 (file)
@@ -99,7 +99,7 @@ void debuginfod_end (debuginfod_client *c) { }
 #include <regex.h>
 #include <string.h>
 #include <stdbool.h>
-#include <linux/limits.h>
+#include <limits.h>
 #include <time.h>
 #include <utime.h>
 #include <sys/syscall.h>
@@ -110,6 +110,10 @@ void debuginfod_end (debuginfod_client *c) { }
 #include <fnmatch.h>
 #include <json-c/json.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 /* If fts.h is included before config.h, its indirect inclusions may not
    give us the right LFS aliases of these functions, so map them manually.  */
 #ifdef BAD_FTS