Merge branch 'backport-3178-mtime-fix-glib-2-74' into 'glib-2-74'

Backport !3178 “glocalfileinfo: Don't reset mtime tv_sec when setting tv_usec” to glib-2-74

See merge request GNOME/glib!3182
This commit is contained in:
Marco Trevisan 2023-01-17 14:55:00 +00:00
commit c28829fe87

View File

@ -2759,6 +2759,7 @@ set_mtime_atime (char *filename,
{ {
if (lazy_stat (filename, &statbuf, &got_stat) == 0) if (lazy_stat (filename, &statbuf, &got_stat) == 0)
{ {
times_n[1].tv_sec = statbuf.st_mtime;
#if defined (HAVE_STRUCT_STAT_ST_MTIMENSEC) #if defined (HAVE_STRUCT_STAT_ST_MTIMENSEC)
times_n[1].tv_nsec = statbuf.st_mtimensec; times_n[1].tv_nsec = statbuf.st_mtimensec;
#elif defined (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC) #elif defined (HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)