| 1470 | |
| 1471 | #ifdef HAVE_UTIMES |
| 1472 | int 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 |
| 1495 | int do_utime(const char *path, STRUCT_STAT *stp) |