From 416bb21cb22233ec0f88b54cf6ca3feb85b0f0a1 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 28 Jan 2009 22:20:34 +0100 Subject: [PATCH] Use AC_SYS_LONG_FILE_NAMES to check if the system supports file names longer than 14 characters. --- src/acconfig.h | 9 --------- src/configure.in | 12 +----------- src/os.h | 4 ++++ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/acconfig.h b/src/acconfig.h index 8fda78f..bc324d5 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -543,15 +543,6 @@ #undef SHADOWPW /* - * If you are on a SYS V machine that restricts filename length to 14 - * characters, you may need to enforce that by setting NAME_MAX to 14 - */ -/* KEEP_UNDEF_HERE override system value - * (Will this even work as expected? -mjc) */ -#undef NAME_MAX -#undef NAME_MAX - -/* * define HAVE_NL_LANGINFO if your system has the nl_langinfo() call * and defines CODESET. */ diff --git a/src/configure.in b/src/configure.in index 919437b..9db3dd6 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1202,17 +1202,7 @@ main() { exit(0); /* libc version works properly. */ }], AC_DEFINE(USEMEMCPY)) -AC_MSG_CHECKING(long file names) -(echo 1 > /tmp/conftest9012345) 2>/dev/null -(echo 2 > /tmp/conftest9012346) 2>/dev/null -val=`cat /tmp/conftest9012345 2>/dev/null` -if test -f /tmp/conftest9012345 && test "$val" = 1; then -AC_MSG_RESULT(yes) -else -AC_MSG_RESULT(no) -AC_DEFINE(NAME_MAX, 14) -fi -rm -f /tmp/conftest* +AC_SYS_LONG_FILE_NAMES AC_MSG_CHECKING(for vsprintf) AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no)) diff --git a/src/os.h b/src/os.h index 5bf417d..be20572 100644 --- a/src/os.h +++ b/src/os.h @@ -41,6 +41,10 @@ # include #endif /* __bsdi__ || __386BSD__ || _CX_UX || hpux || _IBMR2 || linux */ +#ifndef HAVE_LONG_FILE_NAMES +#define NAME_MAX 14 +#endif + #ifdef ISC # ifdef ENAMETOOLONG # undef ENAMETOOLONG -- 2.11.4.GIT