From 3d7ef021fafb46a4f31ecc9e5665750f684180f3 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 3 Sep 2015 16:06:07 -0700 Subject: BZ#18921: Fix opendir inverted o_directory_works test. --- ChangeLog | 8 ++++++++ sysdeps/posix/opendir.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3d9265602e..3a6d697bec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-09-03 Roland McGrath + + [BZ #18921] + * sysdeps/posix/opendir.c (need_isdir_precheck) [O_DIRECTORY]: + Fix inverted sense of test of 'o_directory_works' value. + Reported by Pádraig Brady , diagnosed by + Bernhard Voelker . + 2015-09-03 Joseph Myers [BZ #14912] diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c index 6509f5c05c..9edf056fb3 100644 --- a/sysdeps/posix/opendir.c +++ b/sysdeps/posix/opendir.c @@ -105,7 +105,7 @@ need_isdir_precheck (void) tryopen_o_directory (); /* We can skip the expensive `stat' call if O_DIRECTORY works. */ - return o_directory_works > 0; + return o_directory_works < 0; #endif return true; } -- cgit v1.2.1