summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/readlink.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1998-06-23 14:39:32 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1998-06-23 14:39:32 +0000
commitdf00b2c58d350db5e64e1becd76816c626268289 (patch)
tree90c8496245233960f94bcf7e5b3287b800bdf9c8 /otherlibs/unix/readlink.c
parent840152fd2d0a26db041dc5e645f20eb67b157ae1 (diff)
Remplacer MAXPATHLEN par PATH_MAX
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1993 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/readlink.c')
-rw-r--r--otherlibs/unix/readlink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/otherlibs/unix/readlink.c b/otherlibs/unix/readlink.c
index 885b6243a..2e41cbce8 100644
--- a/otherlibs/unix/readlink.c
+++ b/otherlibs/unix/readlink.c
@@ -19,9 +19,17 @@
#include <sys/param.h>
#include "unixsupport.h"
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAN MAXPATHLEN
+#else
+#define PATH_MAX 512
+#endif
+#endif
+
value unix_readlink(value path) /* ML */
{
- char buffer[MAXPATHLEN];
+ char buffer[PATH_MAX];
int len;
len = readlink(String_val(path), buffer, sizeof(buffer) - 1);
if (len == -1) uerror("readlink", path);