020-no-utime.patch 719 B

123456789101112131415161718192021222324252627
  1. --- a/bzip2.c
  2. +++ b/bzip2.c
  3. @@ -69,7 +69,6 @@
  4. #if BZ_UNIX
  5. # include <fcntl.h>
  6. # include <sys/types.h>
  7. -# include <utime.h>
  8. # include <unistd.h>
  9. # include <sys/stat.h>
  10. # include <sys/times.h>
  11. @@ -1051,12 +1050,12 @@ void applySavedTimeInfoToOutputFile ( Ch
  12. {
  13. # if BZ_UNIX
  14. IntNative retVal;
  15. - struct utimbuf uTimBuf;
  16. + struct timespec uTimBuf[2] = {};
  17. - uTimBuf.actime = fileMetaInfo.st_atime;
  18. - uTimBuf.modtime = fileMetaInfo.st_mtime;
  19. + uTimBuf[0].tv_sec = fileMetaInfo.st_atime;
  20. + uTimBuf[1].tv_sec = fileMetaInfo.st_mtime;
  21. - retVal = utime ( dstName, &uTimBuf );
  22. + retVal = utimensat ( AT_FDCWD, dstName, uTimBuf , 0 );
  23. ERROR_IF_NOT_ZERO ( retVal );
  24. # endif
  25. }