From be628a94e2582fa8415284d21047514354a76515 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 8 Sep 2009 15:59:51 +0000 Subject: [PATCH] * opendir() is supposed to return ENOTDIR if the given path is not a directory, we returned EINVAL instead, which caused Perl's internal glob() implementation to fail prematurely +alphabranch (will do that myself in a minute) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32999 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/dirent.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/posix/dirent.c b/src/system/libroot/posix/dirent.c index 5db1f26275..b827ec134d 100644 --- a/src/system/libroot/posix/dirent.c +++ b/src/system/libroot/posix/dirent.c @@ -123,7 +123,10 @@ opendir(const char* path) int fd = _kern_open_dir(-1, path); if (fd < 0) { - errno = fd; + if (fd == B_BAD_VALUE) + errno = B_NOT_A_DIRECTORY; + else + errno = fd; return NULL; }