diff options
author | 2014-07-05 06:45:00 +0000 | |
---|---|---|
committer | 2014-07-05 06:45:00 +0000 | |
commit | a0369b219b0ef7705c05e6f4629f5247c439273a (patch) | |
tree | 4eb61fe8cabfe482043f8993f2443489fe956bfe | |
parent | Oops, fix both locations using D_NAMLEN() (diff) | |
download | wireguard-openbsd-a0369b219b0ef7705c05e6f4629f5247c439273a.tar.xz wireguard-openbsd-a0369b219b0ef7705c05e6f4629f5247c439273a.zip |
Assume POSIX: <dirent.h>, struct dirent
-rw-r--r-- | usr.bin/rdist/client.c | 6 | ||||
-rw-r--r-- | usr.bin/rdist/config-data.h | 17 | ||||
-rw-r--r-- | usr.bin/rdist/config-def.h | 8 | ||||
-rw-r--r-- | usr.bin/rdist/docmd.c | 11 | ||||
-rw-r--r-- | usr.bin/rdist/expand.c | 6 | ||||
-rw-r--r-- | usr.bin/rdist/os-openbsd.h | 7 | ||||
-rw-r--r-- | usr.bin/rdistd/server.c | 9 |
7 files changed, 23 insertions, 41 deletions
diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c index 17d66472f33..ae4e5c0af73 100644 --- a/usr.bin/rdist/client.c +++ b/usr.bin/rdist/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.27 2014/07/05 05:05:51 guenther Exp $ */ +/* $OpenBSD: client.c,v 1.28 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -29,6 +29,8 @@ * SUCH DAMAGE. */ +#include <dirent.h> + #include "defs.h" #include "y.tab.h" @@ -577,7 +579,7 @@ static int senddir(char *rname, opt_t opts, struct stat *stb, char *user, char *group, int destdir) { - DIRENTRY *dp; + struct dirent *dp; DIR *d; char *optarget, *cp; int len; diff --git a/usr.bin/rdist/config-data.h b/usr.bin/rdist/config-data.h index 86c3d8fdc09..235d04e4d83 100644 --- a/usr.bin/rdist/config-data.h +++ b/usr.bin/rdist/config-data.h @@ -1,4 +1,4 @@ -/* $OpenBSD: config-data.h,v 1.8 2014/07/05 06:18:58 guenther Exp $ */ +/* $OpenBSD: config-data.h,v 1.9 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1993 Michael A. Cooper @@ -50,21 +50,6 @@ #define PIPE_WRITE 1 /* - * Directory information - */ -#if DIR_TYPE == DIR_DIRECT -#include <sys/dir.h> -typedef struct direct DIRENTRY; -#define D_NAMLEN(p) ((p)->d_namlen) -#endif /* DIR_DIRECT */ - -#if DIR_TYPE == DIR_DIRENT -#include <dirent.h> -typedef struct dirent DIRENTRY; -#define D_NAMLEN(p) (strlen((p)->d_name)) -#endif /* DIR_DIRENT */ - -/* * Set default write(2) return and amount types. */ #if !defined(WRITE_RETURN_T) diff --git a/usr.bin/rdist/config-def.h b/usr.bin/rdist/config-def.h index 78ba23178b1..7a689328a35 100644 --- a/usr.bin/rdist/config-def.h +++ b/usr.bin/rdist/config-def.h @@ -1,4 +1,4 @@ -/* $OpenBSD: config-def.h,v 1.9 2014/07/05 06:35:03 guenther Exp $ */ +/* $OpenBSD: config-def.h,v 1.10 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1993 Michael A. Cooper @@ -43,12 +43,6 @@ */ /* - * Types of directory routines - */ -#define DIR_DIRECT 1 -#define DIR_DIRENT 2 - -/* * Types of filesystem info routines */ #define FSI_GETFSSTAT 1 diff --git a/usr.bin/rdist/docmd.c b/usr.bin/rdist/docmd.c index 378eeecbe54..944439c9040 100644 --- a/usr.bin/rdist/docmd.c +++ b/usr.bin/rdist/docmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: docmd.c,v 1.27 2014/07/05 06:18:58 guenther Exp $ */ +/* $OpenBSD: docmd.c,v 1.28 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -29,6 +29,10 @@ * SUCH DAMAGE. */ +#include <sys/socket.h> +#include <dirent.h> +#include <netdb.h> + #include "defs.h" #include "y.tab.h" @@ -36,9 +40,6 @@ * Functions for rdist that do command (cmd) related activities. */ -#include <sys/socket.h> -#include <netdb.h> - struct subcmd *subcmds; /* list of sub-commands for current cmd */ struct namelist *filelist; /* list of source files */ @@ -636,7 +637,7 @@ static void rcmptime(struct stat *st, struct subcmd *sbcmds, char **env) { DIR *d; - DIRENTRY *dp; + struct dirent *dp; char *cp; char *optarget; int len; diff --git a/usr.bin/rdist/expand.c b/usr.bin/rdist/expand.c index f9d86419034..efc1a9e2d0f 100644 --- a/usr.bin/rdist/expand.c +++ b/usr.bin/rdist/expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expand.c,v 1.13 2012/11/12 01:14:41 guenther Exp $ */ +/* $OpenBSD: expand.c,v 1.14 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -29,6 +29,8 @@ * SUCH DAMAGE. */ +#include <dirent.h> + #include "defs.h" #define MAXEARGS 2048 @@ -356,7 +358,7 @@ void matchdir(char *pattern) /* quote in pattern */ { struct stat stb; - DIRENTRY *dp; + struct dirent *dp; DIR *dirp; dirp = opendir(path); diff --git a/usr.bin/rdist/os-openbsd.h b/usr.bin/rdist/os-openbsd.h index c71cc91a980..c119b62b455 100644 --- a/usr.bin/rdist/os-openbsd.h +++ b/usr.bin/rdist/os-openbsd.h @@ -29,7 +29,7 @@ */ /* - * $OpenBSD: os-openbsd.h,v 1.16 2014/07/05 06:35:03 guenther Exp $ + * $OpenBSD: os-openbsd.h,v 1.17 2014/07/05 06:45:00 guenther Exp $ */ /* @@ -51,11 +51,6 @@ #define HAVE_SETPROCTITLE /* - * Define the type of directory routines your system has. - */ -#define DIR_TYPE DIR_DIRENT - -/* * Determine what routines we have to get filesystem info. */ #define FSI_TYPE FSI_GETFSSTAT diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c index 9102fb7b78a..0dc4d645356 100644 --- a/usr.bin/rdistd/server.c +++ b/usr.bin/rdistd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.27 2014/07/05 06:40:54 guenther Exp $ */ +/* $OpenBSD: server.c,v 1.28 2014/07/05 06:45:00 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -28,6 +28,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include <dirent.h> + #include "defs.h" /* @@ -297,7 +300,7 @@ static int removefile(struct stat *statb, int silent) { DIR *d; - static DIRENTRY *dp; + static struct dirent *dp; char *cp; struct stat stb; char *optarget; @@ -407,7 +410,7 @@ static void doclean(char *cp) { DIR *d; - DIRENTRY *dp; + struct dirent *dp; struct stat stb; char *optarget, *ep; int len; |