[git] GPGME - branch, master, updated. gpgme-1.9.0-79-g00daac1
by Daniel Kahn Gillmor
cvs at cvs.gnupg.org
Thu Oct 12 09:04:47 CEST 2017
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 "GnuPG Made Easy".
The branch, master has been updated
via 00daac15530eabed5e61d841b2df939c2242667c (commit)
from 4632adf403611b50be2b4e852a4607070935d0e5 (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 -----------------------------------------------------------------
commit 00daac15530eabed5e61d841b2df939c2242667c
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Wed Oct 11 11:38:39 2017 -0400
core: use getdents64 syscall on linux instead of getdents.
* src/posix-io.c (get_max_fds): use getdents64 instead of getdents.
--
getdents64 was introduced in linux 2.4, so it should be widely
available. some Linux architectures which post-date 2.4 (e.g. arm64)
appear to not have getdents at all, so it's probably better to use the
more modern interface.
Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
diff --git a/src/posix-io.c b/src/posix-io.c
index 9b7b181..0448d29 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -282,13 +282,14 @@ _gpgme_io_set_nonblocking (int fd)
#ifdef USE_LINUX_GETDENTS
-/* This is not declared in public headers; getdents(2) says that we must
+/* This is not declared in public headers; getdents64(2) says that we must
* define it ourselves. */
-struct linux_dirent
+struct linux_dirent64
{
- unsigned long d_ino;
- unsigned long d_off;
+ ino64_t d_ino;
+ off64_t d_off;
unsigned short d_reclen;
+ unsigned char d_type;
char d_name[];
};
@@ -316,7 +317,7 @@ get_max_fds (void)
{
int dir_fd;
char dir_buf[DIR_BUF_SIZE];
- struct linux_dirent *dir_entry;
+ struct linux_dirent64 *dir_entry;
int r, pos;
const char *s;
int x;
@@ -326,7 +327,7 @@ get_max_fds (void)
{
for (;;)
{
- r = syscall(SYS_getdents, dir_fd, dir_buf, DIR_BUF_SIZE);
+ r = syscall(SYS_getdents64, dir_fd, dir_buf, DIR_BUF_SIZE);
if (r == -1)
{
/* Fall back to other methods. */
@@ -338,7 +339,7 @@ get_max_fds (void)
for (pos = 0; pos < r; pos += dir_entry->d_reclen)
{
- dir_entry = (struct linux_dirent *) (dir_buf + pos);
+ dir_entry = (struct linux_dirent64 *) (dir_buf + pos);
s = dir_entry->d_name;
if (*s < '0' || *s > '9')
continue;
-----------------------------------------------------------------------
Summary of changes:
src/posix-io.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list