| 1493 | |
| 1494 | #elif defined HAVE_UTIME |
| 1495 | int 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. |