[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-5062-g0f0bb263
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-5062-g0f0bb263 |
Date: |
Thu, 25 May 2023 03:39:54 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-5.2-stable has been updated
via 0f0bb263dcd493a9a3db44ee881111ff2606f383 (commit)
from 45d7bc53ca6126c73d9895992630b196633152d3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0f0bb263dcd493a9a3db44ee881111ff2606f383
commit 0f0bb263dcd493a9a3db44ee881111ff2606f383
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Thu May 25 10:39:32 2023 +0300
Sync somewhat readdir.c and readdir_test.c.
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 4d34d825..e5099128 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,8 @@
+2023-05-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * readdir_test.c: Sync somewhat with readdir.c. A full
+ sync is W.I.P.
+
2023-05-24 Arnold D. Robbins <arnold@skeeve.com>
* readdir.c (dir_can_take_file): Only check the stat buffer;
diff --git a/extension/readdir_test.c b/extension/readdir_test.c
index 5d4b1805..45b19993 100644
--- a/extension/readdir_test.c
+++ b/extension/readdir_test.c
@@ -11,7 +11,7 @@
*/
/*
- * Copyright (C) 2012-2014, 2017, 2018, 2019, 2023,
+ * Copyright (C) 2012-2014, 2017, 2018, 2019, 2021, 2023,
* the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
@@ -110,7 +110,7 @@ ftype(struct dirent *entry, const char *dirname)
case DT_REG: return "f";
case DT_SOCK: return "s";
default:
- case DT_UNKNOWN: break; // JFS returns 'u', so fall through to stat
+ case DT_UNKNOWN: break; // JFS returns 'u', so fall through and stat
}
#endif
char fname[PATH_MAX];
@@ -150,6 +150,7 @@ get_inode(struct dirent *entry, const char *dirname)
#ifdef __MINGW32__
char fname[PATH_MAX];
HANDLE fh;
+ BOOL ok;
BY_HANDLE_FILE_INFORMATION info;
sprintf(fname, "%s\\%s", dirname, entry->d_name);
@@ -157,7 +158,9 @@ get_inode(struct dirent *entry, const char *dirname)
FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (fh == INVALID_HANDLE_VALUE)
return 0;
- if (GetFileInformationByHandle(fh, &info)) {
+ ok = GetFileInformationByHandle(fh, &info);
+ CloseHandle(fh);
+ if (ok) {
long long inode = info.nFileIndexHigh;
inode <<= 32;
@@ -257,7 +260,7 @@ dir_can_take_file(const awk_input_buf_t *iobuf)
if (iobuf == NULL)
return awk_false;
- return (iobuf->fd != INVALID_HANDLE || S_ISDIR(iobuf->sbuf.st_mode));
+ return (S_ISDIR(iobuf->sbuf.st_mode));
}
/*
@@ -278,12 +281,15 @@ dir_take_control_of(awk_input_buf_t *iobuf)
dp = fdopendir(iobuf->fd);
#else
dp = opendir(iobuf->name);
- if (dp != NULL)
+ if (dp != NULL) {
+ if (iobuf->fd != INVALID_HANDLE)
+ (void) close(iobuf->fd);
iobuf->fd = dirfd(dp);
+ }
#endif
if (dp == NULL) {
- warning(ext_id, _("dir_take_control_of: opendir/fdopendir
failed: %s"),
- strerror(errno));
+ warning(ext_id, _("dir_take_control_of: %s: opendir/fdopendir
failed: %s"),
+ iobuf->name, strerror(errno));
update_ERRNO_int(errno);
return awk_false;
}
-----------------------------------------------------------------------
Summary of changes:
extension/ChangeLog | 5 +++++
extension/readdir_test.c | 20 +++++++++++++-------
2 files changed, 18 insertions(+), 7 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-5062-g0f0bb263,
Arnold Robbins <=