diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt index 7ffe0e184..fc3a88798 100644 --- a/Utilities/cmtar/CMakeLists.txt +++ b/Utilities/cmtar/CMakeLists.txt @@ -140,14 +140,6 @@ ELSE(HAVE_SIZEOF_UINT64_T) SET (uint64_t "long long") ENDIF(HAVE_SIZEOF_UINT64_T) -CHECK_TYPE_SIZE("socklen_t" SIZEOF_SOCKLEN_T) -IF(HAVE_SIZEOF_SOCKLEN_T) - SET (HAVE_SOCKLEN_T 1) -ELSE(HAVE_SIZEOF_SOCKLEN_T) - SET (HAVE_SOCKLEN_T 0) - SET (socklen_t "unsigned long") -ENDIF(HAVE_SIZEOF_SOCKLEN_T) - CHECK_TYPE_SIZE("gid_t" SIZEOF_GID_T) IF(HAVE_SIZEOF_GID_T) SET (HAVE_GID_T 1) @@ -211,7 +203,6 @@ SET (HAVE_LIBZ 1) #SET (HAVE_MINOR_T 0) #SET (HAVE_NLINK_T 1) #SET (HAVE_SNPRINTF 1) -#SET (HAVE_SOCKLEN_T 1) #SET (HAVE_STDINT_H 1) #SET (HAVE_STDLIB_H 1) #SET (HAVE_STRDUP 1) @@ -254,7 +245,6 @@ SET (const 0) #SET (nlink_t 0) #SET (off_t 0) #SET (size_t 0) -#SET (socklen_t 0) #SET (uid_t 0) #SET (uint64_t 0) SET (LISTHASH_PREFIX "libtar") @@ -357,7 +347,7 @@ ENDIF(NOT HAVE_FNMATCH) CONFIGURE_FILE(${LIBTAR_SOURCE_DIR}/config.h.in ${LIBTAR_BINARY_DIR}/libtar/config.h) -ADD_LIBRARY(tar STATIC ${libtar_SRC}) +ADD_LIBRARY(cmtar STATIC ${libtar_SRC}) ADD_EXECUTABLE(tartest libtar.c) -TARGET_LINK_LIBRARIES(tartest tar ${CMAKE_ZLIB_LIBRARIES}) +TARGET_LINK_LIBRARIES(tartest cmtar ${CMAKE_ZLIB_LIBRARIES}) diff --git a/Utilities/cmtar/compat/compat.h b/Utilities/cmtar/compat/compat.h index f308b9951..ae46f368b 100644 --- a/Utilities/cmtar/compat/compat.h +++ b/Utilities/cmtar/compat/compat.h @@ -313,11 +313,13 @@ char *strsep(register char **, register const char *); #define S_ISFIFO(m) (((m)&S_IFFIFO)==S_IFFIFO) #endif -#if defined(PATH_MAX) -# define TAR_MAXPATHLEN PATH_MAX -#elif defined(MAXPATHLEN) -# define TAR_MAXPATHLEN MAXPATHLEN -#else -# define TAR_MAXPATHLEN 16384 +#if !defined(TAR_MAXPATHLEN) +# if defined(PATH_MAX) +# define TAR_MAXPATHLEN PATH_MAX +# elif defined(MAXPATHLEN) +# define TAR_MAXPATHLEN MAXPATHLEN +# else +# define TAR_MAXPATHLEN 16384 +# endif #endif diff --git a/Utilities/cmtar/config.h.in b/Utilities/cmtar/config.h.in index b22bfac97..670223849 100644 --- a/Utilities/cmtar/config.h.in +++ b/Utilities/cmtar/config.h.in @@ -45,9 +45,6 @@ /* Define if your system has a working snprintf */ #cmakedefine HAVE_SNPRINTF @HAVE_SNPRINTF@ -/* Define to 1 if the system has the type `socklen_t'. */ -#cmakedefine HAVE_SOCKLEN_T @HAVE_SOCKLEN_T@ - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@ @@ -183,9 +180,6 @@ /* Define to `int' if does not define. */ #cmakedefine ssize_t @size_t@ -/* Define to `unsigned long' if not defined in system header files. */ -#cmakedefine socklen_t @socklen_t@ - /* Define to `int' if doesn't define. */ #cmakedefine uid_t @uid_t@ diff --git a/Utilities/cmtar/handle.c b/Utilities/cmtar/handle.c index 5238e0367..3bf4c2849 100644 --- a/Utilities/cmtar/handle.c +++ b/Utilities/cmtar/handle.c @@ -56,6 +56,7 @@ static int tar_init(TAR **t, char *pathname, tartype_t *type, int oflags, int mode, int options) { + (void)mode; if ((oflags & O_ACCMODE) == O_RDWR) { errno = EINVAL;