Skip to content

Commit

Permalink
Fix hard dependency on non-POSIX GLOB_ONLYDIR flag
Browse files Browse the repository at this point in the history
This regressed when we axed our internal glob copy in commit
66fa46c. Luckily GLOB_ONLYDIR is only
an optimization so we can just skip it if not available.
  • Loading branch information
pmatilai committed Dec 18, 2023
1 parent 33c47c2 commit 7a30644
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ if (LIBDW_FOUND)
set(HAVE_LIBDW 1)
endif()

check_symbol_exists(GLOB_ONLYDIR "glob.h" HAVE_GLOB_ONLYDIR)
check_symbol_exists(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
if (NOT MAJOR_IN_SYSMACROS)
check_symbol_exists(major "sys/mkdev.h" MAJOR_IN_MKDEV)
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
#cmakedefine HAVE_ZSTD @HAVE_ZSTD@
#cmakedefine HAVE___PROGNAME @HAVE___PROGNAME@
#cmakedefine HAVE___SECURE_GETENV @HAVE___SECURE_GETENV@
#cmakedefine HAVE_GLOB_ONLYDIR @HAVE_GLOB_ONLYDIR@
#cmakedefine MAJOR_IN_MKDEV @MAJOR_IN_MKDEV@
#cmakedefine MAJOR_IN_SYSMACROS @MAJOR_IN_SYSMACROS@
#cmakedefine RUNDIR @rundir@
Expand Down
2 changes: 2 additions & 0 deletions rpmio/rpmglob.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ int rpmGlobPath(const char * pattern, rpmglobFlags flags,
gflags |= GLOB_BRACE;
if (home != NULL && strlen(home) > 0)
gflags |= GLOB_TILDE;
#if HAVE_GLOB_ONLYDIR
if (dir_only)
gflags |= GLOB_ONLYDIR;
#endif
if (flags & RPMGLOB_NOCHECK)
gflags |= GLOB_NOCHECK;

Expand Down

0 comments on commit 7a30644

Please sign in to comment.