Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorScott J. Goldman <scottjgo@gmail.com>2012-05-10 10:45:55 +0400
committerScott J. Goldman <scottjgo@gmail.com>2012-05-12 20:51:32 +0400
commit6fb1c0b489c49b761eeddd655dd01e61d402722d (patch)
tree439eda0a4863656b4301280e2671d25c84994a04 /src/unix
parentb1ec25facc4fe0cf7633e05f340e689c9f728ed0 (diff)
Fix readdir_r() usage for Solaris
On Solaris, struct dirent is defined differently than Linux. The field containing the path name is of size 0, rather than NAME_MAX. So, we need to use a properly sized buffer on Solaris to avoid a stack overflow. Also fix some DIR* leaks on cleanup.
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/posix.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/unix/posix.h b/src/unix/posix.h
index 6d0d0dfa6..48b492941 100644
--- a/src/unix/posix.h
+++ b/src/unix/posix.h
@@ -14,6 +14,8 @@
# include "compat/fnmatch.h"
#endif
+#include <stdio.h>
+
#define p_lstat(p,b) lstat(p,b)
#define p_readlink(a, b, c) readlink(a, b, c)
#define p_link(o,n) link(o, n)