diff options
author | Scott J. Goldman <scottjgo@gmail.com> | 2012-05-09 23:45:55 -0700 |
---|---|---|
committer | Scott J. Goldman <scottjgo@gmail.com> | 2012-05-12 09:51:32 -0700 |
commit | 6fb1c0b489c49b761eeddd655dd01e61d402722d (patch) | |
tree | 439eda0a4863656b4301280e2671d25c84994a04 /src/unix | |
parent | b1ec25facc4fe0cf7633e05f340e689c9f728ed0 (diff) | |
download | libgit2-6fb1c0b489c49b761eeddd655dd01e61d402722d.tar.gz |
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.h | 2 |
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) |