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

Function do_utime

syscall.c:1495–1515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1493
1494#elif defined HAVE_UTIME
1495int do_utime(const char *path, STRUCT_STAT *stp)
1496{
1497#ifdef HAVE_STRUCT_UTIMBUF
1498 struct utimbuf tbuf;
1499#else
1500 time_t t[2];
1501#endif
1502
1503 if (dry_run) return 0;
1504 RETURN_ERROR_IF_RO_OR_LO;
1505
1506# ifdef HAVE_STRUCT_UTIMBUF
1507 tbuf.actime = stp->st_atime;
1508 tbuf.modtime = stp->st_mtime;
1509 return utime(path, &tbuf);
1510# else
1511 t[0] = stp->st_atime;
1512 t[1] = stp->st_mtime;
1513 return utime(path, t);
1514# endif
1515}
1516
1517#else
1518#error Need utimes or utime function.

Callers 1

set_timesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected