mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 03:16:59 -05:00
More precise file modification time, now using nanoseconds.
This commit is contained in:
parent
97b0464d75
commit
71c7f4dffb
15 changed files with 130 additions and 40 deletions
4
scan.c
4
scan.c
|
|
@ -172,7 +172,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state,
|
|||
}
|
||||
|
||||
/* check if the file is not changed */
|
||||
if (file->size == st->st_size && file->mtime == st->st_mtime) {
|
||||
if (file->size == st->st_size && file->mtime_sec == st->st_mtime && file->mtime_nsec == st->st_mtim.tv_nsec) {
|
||||
/* mark as present */
|
||||
file_flag_set(file, FILE_IS_PRESENT);
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state,
|
|||
}
|
||||
|
||||
/* insert it */
|
||||
file = file_alloc(state->block_size, sub, st->st_size, st->st_mtime, st->st_ino);
|
||||
file = file_alloc(state->block_size, sub, st->st_size, st->st_mtime, st->st_mtim.tv_nsec, st->st_ino);
|
||||
|
||||
/* mark it as present */
|
||||
file_flag_set(file, FILE_IS_PRESENT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue