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

Function do_utimensat

syscall.c:1349–1369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1347
1348#ifdef HAVE_UTIMENSAT
1349int do_utimensat(const char *path, STRUCT_STAT *stp)
1350{
1351 struct timespec t[2];
1352
1353 if (dry_run) return 0;
1354 RETURN_ERROR_IF_RO_OR_LO;
1355
1356 t[0].tv_sec = stp->st_atime;
1357#ifdef ST_ATIME_NSEC
1358 t[0].tv_nsec = stp->ST_ATIME_NSEC;
1359#else
1360 t[0].tv_nsec = 0;
1361#endif
1362 t[1].tv_sec = stp->st_mtime;
1363#ifdef ST_MTIME_NSEC
1364 t[1].tv_nsec = stp->ST_MTIME_NSEC;
1365#else
1366 t[1].tv_nsec = 0;
1367#endif
1368 return utimensat(AT_FDCWD, path, t, AT_SYMLINK_NOFOLLOW);
1369}
1370
1371/*
1372 Symlink-race-safe variant of do_utimensat() for receiver-side use.

Callers 1

do_utimensat_atFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected