diff options
| author | James McCoy <jamessan@jamessan.com> | 2019-10-29 16:08:55 -0400 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-10-29 16:08:55 -0400 |
| commit | 04bdaf9a1eb1406f83321e98daf08b0f06a8401b (patch) | |
| tree | de29360c3c54a95bbcac7c9c8e5fcc5ef2ba1bf0 /src | |
| parent | 1dfb8c41e8a7e689959baeaf2961437db9615f74 (diff) | |
| download | luafilesystem-04bdaf9a1eb1406f83321e98daf08b0f06a8401b.tar.gz luafilesystem-04bdaf9a1eb1406f83321e98daf08b0f06a8401b.tar.bz2 luafilesystem-04bdaf9a1eb1406f83321e98daf08b0f06a8401b.zip | |
Fallback to _POSIX_PATH_MAX when MAXPATHLEN isn't available (#130)
On systems where MAXPATHLEN isn't defined, like GNU/Hurd, use
_POSIX_PATH_MAX as the starting size for the getcwd() buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -60,7 +60,12 @@ | |||
| 60 | #include <sys/types.h> | 60 | #include <sys/types.h> |
| 61 | #include <utime.h> | 61 | #include <utime.h> |
| 62 | #include <sys/param.h> /* for MAXPATHLEN */ | 62 | #include <sys/param.h> /* for MAXPATHLEN */ |
| 63 | #define LFS_MAXPATHLEN MAXPATHLEN | 63 | #ifdef MAXPATHLEN |
| 64 | #define LFS_MAXPATHLEN MAXPATHLEN | ||
| 65 | #else | ||
| 66 | #include <limits.h> /* for _POSIX_PATH_MAX */ | ||
| 67 | #define LFS_MAXPATHLEN _POSIX_PATH_MAX | ||
| 68 | #endif | ||
| 64 | #endif | 69 | #endif |
| 65 | 70 | ||
| 66 | #include <lua.h> | 71 | #include <lua.h> |
