mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-16 02:50:40 +01:00
Merge pull request #4701 from rgerhards/MAXPATHLEN
build issue: handle undefined MAXPATHLEN
This commit is contained in:
commit
d2a8c5be8b
14
configure.ac
14
configure.ac
@ -149,6 +149,20 @@ AS_IF([test -d "$srcdir"/.git && ! test -f "$srcdir"/.tarball-version], [in_git
|
||||
|
||||
AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable])
|
||||
|
||||
# Some Unix systems, like Gnu Hurd, don't define PATH_MAX
|
||||
AC_MSG_CHECKING([for PATH_MAX])
|
||||
AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <limits.h>]],
|
||||
[[char checker[PATH_MAX];]])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no, mocking PATH_MAX = 4096])
|
||||
AC_DEFINE([PATH_MAX], 4096, [replacement for missing PATH_MAX])
|
||||
AC_DEFINE([MAXPATHLEN], 4096, [replacement for missing PATH_MAX]) # we assume this does not exit
|
||||
]
|
||||
)
|
||||
|
||||
# Checks for libraries.
|
||||
save_LIBS=$LIBS
|
||||
LIBS=
|
||||
|
||||
@ -49,10 +49,6 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/file.h>
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
#endif
|
||||
|
||||
#include "rsyslog.h"
|
||||
#include "rainerscript.h"
|
||||
#include "cfsysline.h"
|
||||
@ -1101,11 +1097,7 @@ Load(uchar *const pModName, const sbool bConfLoad, struct nvlst *const lst)
|
||||
uchar *pModDirCurr, *pModDirNext;
|
||||
int iLoadCnt;
|
||||
struct dlhandle_s *pHandle = NULL;
|
||||
# ifdef PATH_MAX
|
||||
uchar pathBuf[PATH_MAX+1];
|
||||
# else
|
||||
uchar pathBuf[4096];
|
||||
# endif
|
||||
uchar *pPathBuf = pathBuf;
|
||||
size_t lenPathBuf = sizeof(pathBuf);
|
||||
rsRetVal localRet;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user