From a6e121aaa0ab61965db2dcfe8e2ba5d719fbe1e6 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 7 Oct 2010 21:39:17 +1100 Subject: - djm@cvs.openbsd.org 2010/09/25 09:30:16 [sftp.c configure.ac openbsd-compat/glob.c openbsd-compat/glob.h] make use of new glob(3) GLOB_KEEPSTAT extension to save extra server rountrips to fetch per-file stat(2) information. NB. update openbsd-compat/ glob(3) implementation from OpenBSD libc to match. --- openbsd-compat/glob.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'openbsd-compat/glob.h') diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index a2b36f974..8ea391306 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -1,4 +1,4 @@ -/* $OpenBSD: glob.h,v 1.10 2005/12/13 00:35:22 millert Exp $ */ +/* $OpenBSD: glob.h,v 1.11 2010/09/24 13:32:55 djm Exp $ */ /* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */ /* @@ -38,13 +38,16 @@ /* OPENBSD ORIGINAL: include/glob.h */ #if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) || \ + !defined(GLOB_HAS_GL_MATCHC) || !define(GLOB_HAS_GL_STATV) \ !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0 || \ defined(BROKEN_GLOB) #ifndef _GLOB_H_ #define _GLOB_H_ +#include +#include + struct stat; typedef struct { int gl_pathc; /* Count of total paths so far. */ @@ -52,6 +55,7 @@ typedef struct { int gl_offs; /* Reserved at beginning of gl_pathv. */ int gl_flags; /* Copy of flags parameter to glob. */ char **gl_pathv; /* List of paths matching pattern. */ + struct stat **gl_statv; /* Stat entries corresponding to gl_pathv */ /* Copy of errfunc parameter to glob. */ int (*gl_errfunc)(const char *, int); @@ -75,12 +79,10 @@ typedef struct { #define GLOB_NOSORT 0x0020 /* Don't sort. */ #define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */ -/* Error values returned by glob(3) */ #define GLOB_NOSPACE (-1) /* Malloc call failed. */ #define GLOB_ABORTED (-2) /* Unignored error. */ #define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK not set. */ #define GLOB_NOSYS (-4) /* Function not supported. */ -#define GLOB_ABEND GLOB_ABORTED #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ @@ -89,6 +91,8 @@ typedef struct { #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ #define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */ +#define GLOB_KEEPSTAT 0x4000 /* Retain stat data for paths in gl_statv. */ +#define GLOB_ABEND GLOB_ABORTED /* backward compatibility */ int glob(const char *, int, int (*)(const char *, int), glob_t *); void globfree(glob_t *); @@ -96,5 +100,5 @@ void globfree(glob_t *); #endif /* !_GLOB_H_ */ #endif /* !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || - !defined(GLOB_HAS_GL_MATCHC */ + !defined(GLOB_HAS_GL_MATCHC) || !defined(GLOH_HAS_GL_STATV) */ -- cgit v1.2.3 From faca8ccd4d44ca0dacb413233c9e9d3e7aabb936 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 7 Oct 2010 21:59:40 +1100 Subject: unbreak previous --- openbsd-compat/glob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsd-compat/glob.h') diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 8ea391306..062282195 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -38,7 +38,7 @@ /* OPENBSD ORIGINAL: include/glob.h */ #if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) || !define(GLOB_HAS_GL_STATV) \ + !defined(GLOB_HAS_GL_MATCHC) || !define(GLOB_HAS_GL_STATV) || \ !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0 || \ defined(BROKEN_GLOB) -- cgit v1.2.3 From 2738361878ec4a4b0d5481d909cd644dce17a94b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 7 Oct 2010 22:00:24 +1100 Subject: sadly, two typos on one line is not my best record --- openbsd-compat/glob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsd-compat/glob.h') diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 062282195..4de16ffc8 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -38,7 +38,7 @@ /* OPENBSD ORIGINAL: include/glob.h */ #if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \ - !defined(GLOB_HAS_GL_MATCHC) || !define(GLOB_HAS_GL_STATV) || \ + !defined(GLOB_HAS_GL_MATCHC) || !defined(GLOB_HAS_GL_STATV) || \ !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0 || \ defined(BROKEN_GLOB) -- cgit v1.2.3 From bdd3e67c1965c262ae6a6ae1ac88d06dc4393bda Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 24 Oct 2010 18:35:55 -0700 Subject: - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with 1.12 to unbreak Solaris build. ok djm@ --- ChangeLog | 5 +++++ openbsd-compat/glob.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsd-compat/glob.h') diff --git a/ChangeLog b/ChangeLog index df2e7295e..f48cbb5c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20101025 + - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with + 1.12 to unbreak Solaris build. + ok djm@ + 20101024 - (dtucker) [includes.h] Add missing ifdef GLOB_HAS_GL_STATV to fix build. - (dtucker) [regress/cert-hostkey.sh] Disable ECC-based tests on platforms diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h index 4de16ffc8..f8a7fa5ff 100644 --- a/openbsd-compat/glob.h +++ b/openbsd-compat/glob.h @@ -45,7 +45,6 @@ #ifndef _GLOB_H_ #define _GLOB_H_ -#include #include struct stat; -- cgit v1.2.3