]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
define PATH_MAX for HURD 54/4254/1
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 1 Nov 2016 09:00:21 +0000 (11:00 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 1 Nov 2016 09:00:21 +0000 (11:00 +0200)
PATH_MAX is not guaranteed to be defined. In parctice, all but the HURD
define it to a constant. It is indeed not safe to assume there won't be
longer paths and Asterisk generally does err safely on such cases.

So even for HURD we'll just pretend PATH_MAX is 4096.

ASTERISK-25070 #close

Change-Id: I53d10ba18c34c132bcb640a5fd8e0da1d9b22db3

include/asterisk.h

index 25737805bca5f5d0f19a9332120652f2389cd2ec..862fa1fe5f56f05dd9c03864408d7f53fb335e77 100644 (file)
 #define AST_FILE_MODE 0666
 #endif
 
+/* Make sure PATH_MAX is defined on platforms (HURD) that don't define it.
+ * Also be sure to handle the case of a path larger than PATH_MAX
+ * (err safely) in the code.
+ */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
+
 #define DEFAULT_LANGUAGE "en"
 
 #define DEFAULT_SAMPLE_RATE 8000