|
Lines 541-554
static int copy_reg(const char *source, const char *dest)
Link Here
|
| 541 |
|
541 |
|
| 542 |
/* Try to copy the old file's modtime and access time. */ |
542 |
/* Try to copy the old file's modtime and access time. */ |
| 543 |
#if defined(HAVE_UTIMENSAT) |
543 |
#if defined(HAVE_UTIMENSAT) |
|
|
544 |
int result; |
| 544 |
{ |
545 |
{ |
| 545 |
struct timespec ts[2]; |
546 |
struct timespec ts[2]; |
| 546 |
|
547 |
|
| 547 |
ts[0] = source_stats.st_ex_atime; |
548 |
ts[0] = source_stats.st_ex_atime; |
| 548 |
ts[1] = source_stats.st_ex_mtime; |
549 |
ts[1] = source_stats.st_ex_mtime; |
|
|
550 |
result = |
| 549 |
utimensat(AT_FDCWD, dest, ts, AT_SYMLINK_NOFOLLOW); |
551 |
utimensat(AT_FDCWD, dest, ts, AT_SYMLINK_NOFOLLOW); |
| 550 |
} |
552 |
} |
| 551 |
#elif defined(HAVE_UTIMES) |
553 |
/* try other methods if utimensat is not supported */ |
|
|
554 |
if (result == -1 && errno == ENOSYS) |
| 555 |
#endif |
| 556 |
#if defined(HAVE_UTIMES) |
| 552 |
{ |
557 |
{ |
| 553 |
struct timeval tv[2]; |
558 |
struct timeval tv[2]; |
| 554 |
|
559 |
|
|
Lines 568-573
static int copy_reg(const char *source, const char *dest)
Link Here
|
| 568 |
tv.modtime = convert_timespec_to_time_t(source_stats.st_ex_mtime); |
573 |
tv.modtime = convert_timespec_to_time_t(source_stats.st_ex_mtime); |
| 569 |
utime(dest, &tv); |
574 |
utime(dest, &tv); |
| 570 |
} |
575 |
} |
|
|
576 |
#else |
| 577 |
{} |
| 571 |
#endif |
578 |
#endif |
| 572 |
|
579 |
|
| 573 |
if (unlink (source) == -1) |
580 |
if (unlink (source) == -1) |
|
Lines 898-904
static int vfswrap_ntimes(vfs_handle_struct *handle,
Link Here
|
| 898 |
} else { |
905 |
} else { |
| 899 |
result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0); |
906 |
result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0); |
| 900 |
} |
907 |
} |
| 901 |
#elif defined(HAVE_UTIMES) |
908 |
/* try other methods if utimensat is not supported */ |
|
|
909 |
if (result == -1 && errno == ENOSYS) |
| 910 |
#endif |
| 911 |
{ |
| 912 |
#if defined(HAVE_UTIMES) |
| 902 |
if (ft != NULL) { |
913 |
if (ft != NULL) { |
| 903 |
struct timeval tv[2]; |
914 |
struct timeval tv[2]; |
| 904 |
tv[0] = convert_timespec_to_timeval(ft->atime); |
915 |
tv[0] = convert_timespec_to_timeval(ft->atime); |
|
Lines 920-925
static int vfswrap_ntimes(vfs_handle_struct *handle,
Link Here
|
| 920 |
errno = ENOSYS; |
931 |
errno = ENOSYS; |
| 921 |
result = -1; |
932 |
result = -1; |
| 922 |
#endif |
933 |
#endif |
|
|
934 |
} |
| 923 |
|
935 |
|
| 924 |
out: |
936 |
out: |
| 925 |
END_PROFILE(syscall_ntimes); |
937 |
END_PROFILE(syscall_ntimes); |
| 926 |
- |
|
|