diff options
author | Ron Yorston <rmy@pobox.com> | 2024-08-09 17:27:40 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-08-09 17:27:40 +0100 |
commit | c80a8e246d340af8a5e0a9254c5c7042bf141192 (patch) | |
tree | 105fa810f64c7210823b67da89ae9beba9ed1c18 | |
parent | e90345c1048f2c53074a1bd88e7870ee6a452b01 (diff) | |
download | busybox-w32-c80a8e246d340af8a5e0a9254c5c7042bf141192.tar.gz busybox-w32-c80a8e246d340af8a5e0a9254c5c7042bf141192.tar.bz2 busybox-w32-c80a8e246d340af8a5e0a9254c5c7042bf141192.zip |
win32: fix another problem with stat(2)
If we can't open a file to preserve its access time (perhaps
because it doesn't belong to us) just try again without bothering
about the access time. I thought I'd already done that, but
that must have been in an alternative reality.
Adds 16 bytes.
(GitHub issue #443)
-rw-r--r-- | win32/mingw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index 97bc95d8e..a7540d220 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -462,9 +462,10 @@ static int has_exec_format(const char *name) | |||
462 | } | 462 | } |
463 | 463 | ||
464 | if (fd < 0) | 464 | if (fd < 0) |
465 | return 0; | 465 | n = open_read_close(name, buf, sizeof(buf)); |
466 | else | ||
467 | n = read_close(fd, buf, sizeof(buf)); | ||
466 | 468 | ||
467 | n = read_close(fd, buf, sizeof(buf)); | ||
468 | if (n < 4) /* Need at least a few bytes and no error */ | 469 | if (n < 4) /* Need at least a few bytes and no error */ |
469 | return 0; | 470 | return 0; |
470 | 471 | ||