MCPcopy Create free account
hub / github.com/RsyncProject/rsync / do_utimes

Function do_utimes

syscall.c:1472–1492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1470
1471#ifdef HAVE_UTIMES
1472int do_utimes(const char *path, STRUCT_STAT *stp)
1473{
1474 struct timeval t[2];
1475
1476 if (dry_run) return 0;
1477 RETURN_ERROR_IF_RO_OR_LO;
1478
1479 t[0].tv_sec = stp->st_atime;
1480#ifdef ST_ATIME_NSEC
1481 t[0].tv_usec = stp->ST_ATIME_NSEC / 1000;
1482#else
1483 t[0].tv_usec = 0;
1484#endif
1485 t[1].tv_sec = stp->st_mtime;
1486#ifdef ST_MTIME_NSEC
1487 t[1].tv_usec = stp->ST_MTIME_NSEC / 1000;
1488#else
1489 t[1].tv_usec = 0;
1490#endif
1491 return utimes(path, t);
1492}
1493
1494#elif defined HAVE_UTIME
1495int do_utime(const char *path, STRUCT_STAT *stp)

Callers 1

set_timesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected