diff --git a/kdecore/io/karchive.cpp b/kdecore/io/karchive.cpp index 24f98d57..e190bb9a 100644 --- a/kdecore/io/karchive.cpp +++ b/kdecore/io/karchive.cpp @@ -42,9 +42,7 @@ #include #include #include -#ifdef Q_OS_UNIX #include // PATH_MAX -#endif class KArchivePrivate { diff --git a/kdecore/io/kfilesystemtype_p.cpp b/kdecore/io/kfilesystemtype_p.cpp index e9343f9d..538f0503 100644 --- a/kdecore/io/kfilesystemtype_p.cpp +++ b/kdecore/io/kfilesystemtype_p.cpp @@ -57,16 +57,30 @@ KFileSystemType::Type determineFileSystemTypeImpl(const QByteArray& path) #elif defined(Q_OS_LINUX) || defined(Q_OS_HURD) # include -# include // LSB 3.2 has statfs in sys/statfs.h, sys/vfs.h is just an empty dummy header # include - -# ifndef AUTOFSNG_SUPER_MAGIC -# define AUTOFSNG_SUPER_MAGIC 0x7d92b1a0 +# if defined(Q_OS_LINUX) +# include # endif + +# ifndef NFS_SUPER_MAGIC +# define NFS_SUPER_MAGIC 0x00006969 +# endif +# ifndef AUTOFS_SUPER_MAGIC +# define AUTOFS_SUPER_MAGIC 0x00000187 +# endif +# ifndef MSDOS_SUPER_MAGIC +# define MSDOS_SUPER_MAGIC 0x00004d44 +# endif +# ifndef SMB_SUPER_MAGIC +# define SMB_SUPER_MAGIC 0x0000517B +#endif # ifndef FUSE_SUPER_MAGIC # define FUSE_SUPER_MAGIC 0x65735546 # endif +# ifndef RAMFS_MAGIC +# define RAMFS_MAGIC 0x858458F6 +# endif // Reverse-engineering without C++ code: // strace stat -f /mnt 2>&1|grep statfs|grep mnt, and look for f_type diff --git a/kdecore/kernel/kstandarddirs.cpp b/kdecore/kernel/kstandarddirs.cpp index 8d444ea5..c5589824 100644 --- a/kdecore/kernel/kstandarddirs.cpp +++ b/kdecore/kernel/kstandarddirs.cpp @@ -63,6 +63,10 @@ #define case_sensitivity Qt::CaseSensitive +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + class KStandardDirs::KStandardDirsPrivate { public: @@ -796,8 +800,8 @@ KStandardDirs::KStandardDirsPrivate::realPath(const QString &dirname) return dirname; } - char realpath_buffer[MAXPATHLEN + 1]; - memset(realpath_buffer, 0, MAXPATHLEN + 1); + char realpath_buffer[PATH_MAX + 1]; + memset(realpath_buffer, 0, PATH_MAX + 1); /* If the path contains symlinks, get the real name */ if (realpath( QFile::encodeName(dirname).constData(), realpath_buffer) != 0) { @@ -846,8 +850,8 @@ KStandardDirs::realPath(const QString &dirname) const QString KStandardDirs::realFilePath(const QString &filename) { - char realpath_buffer[MAXPATHLEN + 1]; - memset(realpath_buffer, 0, MAXPATHLEN + 1); + char realpath_buffer[PATH_MAX + 1]; + memset(realpath_buffer, 0, PATH_MAX + 1); /* If the path contains symlinks, get the real name */ if (realpath( QFile::encodeName(filename).constData(), realpath_buffer) != 0) { @@ -1355,9 +1359,9 @@ static QString readEnvPath(const char *env) #ifdef Q_OS_LINUX static QString executablePrefix() { - char path_buffer[MAXPATHLEN + 1]; - path_buffer[MAXPATHLEN] = 0; - int length = readlink ("/proc/self/exe", path_buffer, MAXPATHLEN); + char path_buffer[PATH_MAX + 1]; + path_buffer[PATH_MAX] = 0; + int length = readlink ("/proc/self/exe", path_buffer, PATH_MAX); if (length == -1) return QString(); diff --git a/kinit/lnusertemp.c b/kinit/lnusertemp.c index 84dc168e..6313adb3 100644 --- a/kinit/lnusertemp.c +++ b/kinit/lnusertemp.c @@ -25,7 +25,6 @@ #include #include #include - #include #include #include @@ -36,6 +35,10 @@ #include #endif +#ifndef PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +#endif + int check_tmp_dir(const char *tmp_dir, int check_ownership); int create_link(const char *file, const char *tmp_dir); int build_link(const char* tmp, const char *tmp_prefix, const char *kde_prefix); diff --git a/kioslave/file/file_unix.cpp b/kioslave/file/file_unix.cpp index ca4cf3ba..d8f64825 100644 --- a/kioslave/file/file_unix.cpp +++ b/kioslave/file/file_unix.cpp @@ -46,10 +46,6 @@ #include #include -#if defined(HAVE_LIMITS_H) -#include // PATH_MAX -#endif - //sendfile has different semantics in different platforms #if defined HAVE_SENDFILE && defined Q_OS_LINUX #define USE_SENDFILE 1 diff --git a/kpty/kpty.cpp b/kpty/kpty.cpp index 32fa553b..4a7d3358 100644 --- a/kpty/kpty.cpp +++ b/kpty/kpty.cpp @@ -107,11 +107,7 @@ extern "C" { #define TTY_GROUP "tty" #ifndef PATH_MAX -# ifdef MAXPATHLEN -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif +# define PATH_MAX _POSIX_PATH_MAX #endif ///////////////////////