[Asterisk-code-review] define PATH MAX for HURD (asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed Nov 2 05:26:14 CDT 2016


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4254 )

Change subject: define PATH_MAX for HURD
......................................................................


define PATH_MAX for HURD

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
---
M include/asterisk.h
1 file changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved



diff --git a/include/asterisk.h b/include/asterisk.h
index 2573780..862fa1f 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -36,6 +36,15 @@
 #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

-- 
To view, visit https://gerrit.asterisk.org/4254
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I53d10ba18c34c132bcb640a5fd8e0da1d9b22db3
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list