Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 3.10)
project(extfstools)

set(CMAKE_POLICY_DEFAULT_CMP0128 NEW)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What problem does this solve?

set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
cmake_policy(SET CMP0126 NEW)
cmake_policy(SET CMP0128 NEW)

set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_find")

Expand Down
10 changes: 5 additions & 5 deletions cmake_find/Finditslib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ endif()
find_path(ITSLIB_PATH NAMES include/itslib/stringutils.h PATHS symlinks/itslib)
if(ITSLIB_PATH STREQUAL "ITSLIB_PATH-NOTFOUND")
include(FetchContent)
FetchContent_Populate(itslib
GIT_REPOSITORY https://github.com/nlitsme/legacy-itslib-library)
FetchContent_Declare(itslib
GIT_REPOSITORY https://github.com/nlitsme/legacy-itslib-library
)
set(itslib_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/itslib-subbuild)
FetchContent_MakeAvailable(itslib)
set(ITSLIB_PATH ${itslib_SOURCE_DIR})
else()
set(itslib_BINARY_DIR ${CMAKE_BINARY_DIR}/itslib-build)
endif()

add_subdirectory(${ITSLIB_PATH})

14 changes: 14 additions & 0 deletions ext2rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
#include <functional>
#include <string>
#include <ctime> // gmtime, strftime
#include <sys/stat.h>
#include <sys/time.h>

#ifndef _BSD_SOURCE
int lutimes(const char *path, const struct timeval *times) {
struct stat psb;
if (lstat(path, &psb) == -1)
return -1;
if (S_ISLNK(psb.st_mode)) {
return 0;
}
return (utimes(path, times));
}
#endif

#ifdef USE_CPPUTILS
#include <cpputils/mmfile.h>
Expand Down