diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2020-03-30 11:29:19 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2020-04-02 13:53:38 +0300 |
commit | 7630389dcd3494c13b74b119cca37f97d2d8445a (patch) | |
tree | 7b28b9dd2a5ce88300131f85bc721ecca42d4d8d /rpmio/rpmglob.c | |
parent | c24ff314616f93129c508bfda5b9334ab20330a2 (diff) | |
download | rpm-7630389dcd3494c13b74b119cca37f97d2d8445a.tar.gz |
Flush 1998 vintage dirent.h compatibility mess from system.h
dirent.h and struct dirent are actually standard on this millenium, the
only thing that isn't is d_type member for which we have and retain
a specific test in configure.ac. Include <dirent.h> where needed,
relatively few places do which makes it even a bigger insult to have
this included from system.h.
Diffstat (limited to 'rpmio/rpmglob.c')
-rw-r--r-- | rpmio/rpmglob.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/rpmio/rpmglob.c b/rpmio/rpmglob.c index 3c497cbef..93f7fa54d 100644 --- a/rpmio/rpmglob.c +++ b/rpmio/rpmglob.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <string.h> +#include <dirent.h> #include <pwd.h> #include <assert.h> #include <sys/stat.h> /* S_ISDIR */ @@ -75,8 +76,6 @@ typedef struct { int (*gl_stat)(const char *, struct stat *); } glob_t; -#define NAMLEN(_d) NLENGTH(_d) - #include <errno.h> #ifndef __set_errno #define __set_errno(val) errno = (val) @@ -746,7 +745,7 @@ glob_in_dir(const char *pattern, const char *directory, int flags, if (fnmatch(pattern, name, fnm_flags) == 0) { struct globlink *new = (struct globlink *) alloca(sizeof(struct globlink)); - len = NAMLEN(d); + len = strlen(d->d_name); new->name = (char *) xmalloc(len + 1); *((char *) mempcpy(new->name, name, len)) = '\0'; |