From 9ece7cd487a5c5b52017858021df64e4c6294218 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 22 Jan 2017 23:09:38 -0600 Subject: [PATCH] libpkgconf: move sys/stat.h inclusion out of stdinc.h to the only other consumer of sys/stat.h --- libpkgconf/pkg.c | 8 ++++++++ libpkgconf/stdinc.h | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index e2007f7..d84427a 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -16,6 +16,10 @@ #include #include +#ifdef HAVE_SYS_STAT_H +# include +#endif + /* * !doc * @@ -446,17 +450,21 @@ pkgconf_pkg_scan_dir(pkgconf_client_t *client, const char *path, void *data, pkg static char filebuf[PKGCONF_BUFSIZE]; pkgconf_pkg_t *pkg; FILE *f; +#ifdef HAVE_SYS_STAT_H struct stat st; +#endif pkgconf_strlcpy(filebuf, path, sizeof filebuf); pkgconf_strlcat(filebuf, "/", sizeof filebuf); pkgconf_strlcat(filebuf, dirent->d_name, sizeof filebuf); +#ifdef HAVE_SYS_STAT_H if (stat(filebuf, &st) == -1) continue; if (!(S_ISREG(st.st_mode))) continue; +#endif f = fopen(filebuf, "r"); if (f == NULL) diff --git a/libpkgconf/stdinc.h b/libpkgconf/stdinc.h index 083af9a..58cc6c7 100644 --- a/libpkgconf/stdinc.h +++ b/libpkgconf/stdinc.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include