@@ -84,6 +84,11 @@ typedef off_t fuse_off_t;
84
84
85
85
#if defined(P_OS_MACOSX )
86
86
#define FS_MAX_ACCEPTABLE_FILENAME_LEN 255
87
+
88
+ #if defined(_DARWIN_FEATURE_64_BIT_INODE )
89
+ #define FUSE_STAT_HAS_BIRTHTIME
90
+ #endif
91
+
87
92
#endif
88
93
89
94
#if defined(P_OS_LINUX )
@@ -427,7 +432,7 @@ void psync_fs_update_openfile_fileid_locked(psync_openfile_t *of, psync_fsfileid
427
432
static void psync_row_to_folder_stat (psync_variant_row row , struct FUSE_STAT * stbuf ){
428
433
memset (stbuf , 0 , sizeof (struct FUSE_STAT ));
429
434
stbuf -> st_ino = folderid_to_inode (psync_get_number (row [0 ]));
430
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
435
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
431
436
stbuf -> st_birthtime = psync_get_number (row [2 ]);
432
437
stbuf -> st_ctime = psync_get_number (row [3 ]);
433
438
stbuf -> st_mtime = stbuf -> st_ctime ;
@@ -454,7 +459,7 @@ static void psync_row_to_file_stat(psync_variant_row row, struct FUSE_STAT *stbu
454
459
if (flags & PSYNC_FOLDER_FLAG_ENCRYPTED )
455
460
size = psync_fs_crypto_plain_size (size );
456
461
memset (stbuf , 0 , sizeof (struct FUSE_STAT ));
457
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
462
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
458
463
stbuf -> st_birthtime = psync_get_number (row [2 ]);
459
464
stbuf -> st_ctime = psync_get_number (row [3 ]);
460
465
stbuf -> st_mtime = stbuf -> st_ctime ;
@@ -480,12 +485,12 @@ static void psync_mkdir_to_folder_stat(psync_fstask_mkdir_t *mk, struct FUSE_STA
480
485
stbuf -> st_ino = folderid_to_inode (mk -> folderid );
481
486
else
482
487
stbuf -> st_ino = taskid_to_inode (- mk -> folderid );
483
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
488
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
484
489
stbuf -> st_birthtime = mk -> ctime ;
485
490
stbuf -> st_ctime = mk -> mtime ;
486
491
stbuf -> st_mtime = mk -> mtime ;
487
492
#else
488
- stbuf -> st_ctime = mk -> ctime ;
493
+ stbuf -> st_ctime = mk -> mtime ;
489
494
stbuf -> st_mtime = mk -> mtime ;
490
495
#endif
491
496
stbuf -> st_atime = stbuf -> st_mtime ;
@@ -517,7 +522,7 @@ static int psync_creat_stat_fake_file(struct FUSE_STAT *stbuf){
517
522
time_t ctime ;
518
523
memset (stbuf , 0 , sizeof (struct FUSE_STAT ));
519
524
ctime = psync_timer_time ();
520
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
525
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
521
526
stbuf -> st_birthtime = ctime ;
522
527
#endif
523
528
stbuf -> st_ctime = ctime ;
@@ -611,14 +616,11 @@ static int psync_creat_local_to_file_stat(psync_fstask_creat_t *cr, struct FUSE_
611
616
}*/
612
617
memset (stbuf , 0 , sizeof (struct FUSE_STAT ));
613
618
stbuf -> st_ino = taskid_to_inode (fileid );
614
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
615
- stbuf -> st_birthtime = st .st_birthtime ;
616
- stbuf -> st_ctime = st .st_ctime ;
617
- stbuf -> st_mtime = st .st_mtime ;
618
- #else
619
- stbuf -> st_ctime = psync_stat_ctime (& st );
620
- stbuf -> st_mtime = psync_stat_mtime (& st );
619
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
620
+ stbuf -> st_birthtime = psync_stat_birthtime (& st );
621
621
#endif
622
+ stbuf -> st_mtime = psync_stat_mtime (& st );
623
+ stbuf -> st_ctime = stbuf -> st_mtime ;
622
624
stbuf -> st_atime = stbuf -> st_mtime ;
623
625
stbuf -> st_mode = S_IFREG | 0644 ;
624
626
stbuf -> st_nlink = 1 ;
@@ -648,7 +650,7 @@ static int psync_creat_static_to_file_stat(psync_fstask_creat_t *cr, struct FUSE
648
650
lc = psync_fstask_creat_get_local (cr );
649
651
memset (stbuf , 0 , sizeof (struct FUSE_STAT ));
650
652
stbuf -> st_ino = cr -> taskid ;
651
- #ifdef _DARWIN_FEATURE_64_BIT_INODE
653
+ #ifdef FUSE_STAT_HAS_BIRTHTIME
652
654
stbuf -> st_birthtime = lc -> ctime ;
653
655
stbuf -> st_ctime = lc -> ctime ;
654
656
stbuf -> st_mtime = lc -> ctime ;
0 commit comments