diff options
| author | Paul Eggert | 2017-05-08 10:46:21 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-05-08 10:49:12 -0700 |
| commit | 7ff7624a7aa62f30cabf14744e182e9ea6156290 (patch) | |
| tree | 6e6e1f2f1226a637f366f16fb4ec2122d0ce72c3 /lib/utimens.c | |
| parent | e93f39d2e6b56319511f778e85da32ba05359668 (diff) | |
| download | emacs-7ff7624a7aa62f30cabf14744e182e9ea6156290.tar.gz emacs-7ff7624a7aa62f30cabf14744e182e9ea6156290.zip | |
Merge from gnulib
This incorporates:
2017-05-08 intprops: don’t depend on ‘verify’
2017-05-07 utimens: on native Windows, improve resolution if fd < 0
2017-05-07 utimens: Improve error code on native Windows
* lib/intprops.h, lib/utimens.c: Copy from gnulib.
Diffstat (limited to 'lib/utimens.c')
| -rw-r--r-- | lib/utimens.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/utimens.c b/lib/utimens.c index 5f3a846ea2f..b4bfa8e3222 100644 --- a/lib/utimens.c +++ b/lib/utimens.c | |||
| @@ -349,11 +349,19 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2]) | |||
| 349 | return 0; | 349 | return 0; |
| 350 | else | 350 | else |
| 351 | { | 351 | { |
| 352 | #if 0 | ||
| 353 | DWORD sft_error = GetLastError (); | 352 | DWORD sft_error = GetLastError (); |
| 354 | fprintf (stderr, "utime SetFileTime error 0x%x\n", (unsigned int) sft_error); | 353 | #if 0 |
| 354 | fprintf (stderr, "fdutimens SetFileTime error 0x%x\n", (unsigned int) sft_error); | ||
| 355 | #endif | 355 | #endif |
| 356 | errno = EINVAL; | 356 | switch (sft_error) |
| 357 | { | ||
| 358 | case ERROR_ACCESS_DENIED: /* fd was opened without O_RDWR */ | ||
| 359 | errno = EACCES; /* not specified by POSIX */ | ||
| 360 | break; | ||
| 361 | default: | ||
| 362 | errno = EINVAL; | ||
| 363 | break; | ||
| 364 | } | ||
| 357 | return -1; | 365 | return -1; |
| 358 | } | 366 | } |
| 359 | } | 367 | } |
| @@ -465,7 +473,9 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2]) | |||
| 465 | return -1; | 473 | return -1; |
| 466 | } | 474 | } |
| 467 | 475 | ||
| 468 | #if HAVE_WORKING_UTIMES | 476 | #ifdef USE_SETFILETIME |
| 477 | return _gl_utimens_windows (file, ts); | ||
| 478 | #elif HAVE_WORKING_UTIMES | ||
| 469 | return utimes (file, t); | 479 | return utimes (file, t); |
| 470 | #else | 480 | #else |
| 471 | { | 481 | { |