fix some inconsistencies related to #297

Fri, 02 May 2025 18:35:58 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 02 May 2025 18:35:58 +0200
changeset 866
4a9227846234
parent 865
0b61e0164b44
child 867
7247b0a586bd

fix some inconsistencies related to #297

dav/sync.c file | annotate | diff | comparison | revisions
dav/system.c file | annotate | diff | comparison | revisions
dav/system.h file | annotate | diff | comparison | revisions
--- a/dav/sync.c	Thu May 01 12:40:00 2025 +0200
+++ b/dav/sync.c	Fri May 02 18:35:58 2025 +0200
@@ -3634,7 +3634,7 @@
         finfo_get_values(fileinfo, &f);
         if((dir->metadata & FINFO_MTIME) == FINFO_MTIME && f.date_set) {
             // set mtime
-            sys_utimbuf t;
+            SYS_UTIMBUF t;
             t.actime = f.last_modified;
             t.modtime = f.last_modified;
             if(sys_utime(path, &t)) {
--- a/dav/system.c	Thu May 01 12:40:00 2025 +0200
+++ b/dav/system.c	Fri May 02 18:35:58 2025 +0200
@@ -528,8 +528,8 @@
     return ret;
 }
 
-int sys_utime(const char* filename, sys_utimbuf* times) {
-    wchar_t* wpath = path2winpath(filename, FALSE, NULL);
+int sys_utime(const char *filename, SYS_UTIMBUF *times) {
+    wchar_t *wpath = path2winpath(filename, FALSE, NULL);
     if (!wpath) {
         fprintf(stderr, "sys_utime: cannot convert path\n");
         return -1;
--- a/dav/system.h	Thu May 01 12:40:00 2025 +0200
+++ b/dav/system.h	Fri May 02 18:35:58 2025 +0200
@@ -38,18 +38,20 @@
 #ifdef _WIN32
 
 #include <Windows.h>
+#ifndef mode_t
 #define mode_t unsigned int
+#endif
 
 #include <sys/utime.h>
-typedef struct _utimbuf sys_utimbuf;
-int sys_utime(const char* filename, sys_utimbuf* times);
+#define SYS_UTIMBUF struct _utimbuf
+int sys_utime(const char *filename, SYS_UTIMBUF *times);
 
 #else // not _WIN32
 
 #include <dirent.h>
 
 #include <utime.h>
-typedef struct utimbuf sys_utimbuf;
+#define SYS_UTIMBUF struct utimbuf
 #define sys_utime utime
 
 #endif // _WIN32

mercurial