Consolidate all the PATH_MAX handling into misc.h

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
This commit is contained in:
Christopher James Halse Rogers 2011-03-09 11:17:27 +11:00 committed by Adam Jackson
parent 021393d1b8
commit d17a9fb841
7 changed files with 19 additions and 58 deletions

View File

@ -39,6 +39,7 @@
#include "xf86Bus.h" #include "xf86Bus.h"
#include "xf86Sbus.h" #include "xf86Sbus.h"
#endif #endif
#include "misc.h"
typedef struct _DevToConfig { typedef struct _DevToConfig {
GDevRec GDev; GDevRec GDev;
@ -514,10 +515,6 @@ configureDDCMonitorSection (int screennum)
return ptr; return ptr;
} }
#if !defined(PATH_MAX)
# define PATH_MAX 1024
#endif
void void
DoConfigure(void) DoConfigure(void)
{ {

View File

@ -370,6 +370,9 @@
#include <sys/wait.h> /* May need to adjust this for other OSs */ #include <sys/wait.h> /* May need to adjust this for other OSs */
/* For PATH_MAX */
#include "misc.h"
/* /*
* Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere, * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
* and it's safe, so just do it. * and it's safe, so just do it.
@ -390,14 +393,6 @@
# undef _POSIX_SOURCE # undef _POSIX_SOURCE
#endif /* _POSIX_SOURCE */ #endif /* _POSIX_SOURCE */
#if !defined(PATH_MAX)
# if defined(MAXPATHLEN)
# define PATH_MAX MAXPATHLEN
# else
# define PATH_MAX 1024
# endif /* MAXPATHLEN */
#endif /* !PATH_MAX */
#ifndef DEV_MEM #ifndef DEV_MEM
#define DEV_MEM "/dev/mem" #define DEV_MEM "/dev/mem"

View File

@ -77,18 +77,13 @@
#undef _POSIX_SOURCE #undef _POSIX_SOURCE
#endif /* _POSIX_SOURCE */ #endif /* _POSIX_SOURCE */
#if !defined(PATH_MAX)
#if defined(MAXPATHLEN)
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif /* MAXPATHLEN */
#endif /* !PATH_MAX */
#if !defined(MAXHOSTNAMELEN) #if !defined(MAXHOSTNAMELEN)
#define MAXHOSTNAMELEN 32 #define MAXHOSTNAMELEN 32
#endif /* !MAXHOSTNAMELEN */ #endif /* !MAXHOSTNAMELEN */
/* For PATH_MAX */
#include "misc.h"
#include "Configint.h" #include "Configint.h"
#include "xf86tokens.h" #include "xf86tokens.h"

View File

@ -178,6 +178,17 @@ typedef struct _xReq *xReqPtr;
#endif #endif
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#endif
/** /**
* Calculate the number of bytes needed to hold bits. * Calculate the number of bytes needed to hold bits.
* @param bits The minimum number of bits needed. * @param bits The minimum number of bits needed.

View File

@ -165,17 +165,6 @@ SOFTWARE.
#endif /* WIN32 */ #endif /* WIN32 */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#endif
#define X_INCLUDE_NETDB_H #define X_INCLUDE_NETDB_H
#include <X11/Xos_r.h> #include <X11/Xos_r.h>
@ -185,14 +174,6 @@ SOFTWARE.
#include "xace.h" #include "xace.h"
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
Bool defeatAccessControl = FALSE; Bool defeatAccessControl = FALSE;
#define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len) #define acmp(a1, a2, len) memcmp((char *)(a1), (char *)(a2), len)

View File

@ -63,17 +63,10 @@ SOFTWARE.
#include <execinfo.h> #include <execinfo.h>
#endif #endif
#include "misc.h"
#include "dixstruct.h" #include "dixstruct.h"
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#if !defined(SYSV) && !defined(WIN32) #if !defined(SYSV) && !defined(WIN32)
#include <sys/resource.h> #include <sys/resource.h>

View File

@ -231,17 +231,6 @@ OsSignal(int sig, OsSigHandlerPtr handler)
#define LOCK_PREFIX "/.X" #define LOCK_PREFIX "/.X"
#define LOCK_SUFFIX "-lock" #define LOCK_SUFFIX "-lock"
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#endif
static Bool StillLocking = FALSE; static Bool StillLocking = FALSE;
static char LockFile[PATH_MAX]; static char LockFile[PATH_MAX];
static Bool nolock = FALSE; static Bool nolock = FALSE;