[PATCH] libutil: find: Define PATH_MAX for GNU/Hurd systems.

Manolis Ragkousis <[email protected]>
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
Hello everyone,

On GNU/Hurd systems PATH_MAX is not defined and as a result the latest
version of Global cannot be built for them.

This patch is a workaround for this.  Defining to 200 was an arbitrary
choice from my part.

Thank you,
Manolis

_______________________________________________
Bug-global mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-global
global-path-max.patch (text/x-patch, 544 B)
/*
 * With this patch, libutil can be built on systems which PATH_MAX is
 * not defined.
 */

diff --git a/libutil/find.h b/libutil/find.h
index 45e3603..b7b908e 100644
--- a/libutil/find.h
+++ b/libutil/find.h
@@ -21,6 +21,12 @@
 #ifndef _FIND_H_
 #define _FIND_H_
 
+/* MAX_PATH is not defined in some platforms, most notably GNU/Hurd.
+   In that case we define it here to some constant. */
+#ifndef PATH_MAX
+# define PATH_MAX 200
+#endif
+
 void set_accept_dotfiles(void);
 void set_skip_unreadable(void);
 int skipthisfile(const char *);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.