Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cielavenir committed Apr 11, 2022
1 parent 7c3d899 commit 3342e86
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions C/Util/7z/7zMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <sys/time.h>
#endif
#include <fcntl.h>
// #include <utime.h>
#include <utime.h>
#include <sys/stat.h>
#include <errno.h>
#endif
Expand Down Expand Up @@ -374,7 +374,7 @@ static Int64 Time_FileTimeToUnixTime64(const FILETIME *ft)
#define MY_ST_TIMESPEC timespec
#endif

#if UTIMENSAT
#ifdef UTIMENSAT
static void FILETIME_To_timespec(const FILETIME *ft, struct MY_ST_TIMESPEC *ts)
{
if (ft)
Expand Down Expand Up @@ -413,10 +413,10 @@ static WRes Set_File_FILETIME(const UInt16 *name, const FILETIME *mTime)
FILETIME_To_timespec(mTime, &times[1]);
res = utimensat(AT_FDCWD, (const char *)buf.data, times, flags);
#else
struct utimbuf buf;
buf.actime = time(0);
buf.modtime = Time_FileTimeToUnixTime64(mTime);
res = utime((const char *)buf.data, &buf);
struct utimbuf tbuf;
tbuf.actime = time(0);
tbuf.modtime = Time_FileTimeToUnixTime64(mTime);
res = utime((const char *)buf.data, &tbuf);
#endif
Buf_Free(&buf, &g_Alloc);
if (res == 0)
Expand Down

0 comments on commit 3342e86

Please sign in to comment.