From 630eed3e6a82470945e0471a12206f060e3a72eb Mon Sep 17 00:00:00 2001 From: mazze Date: Sun, 22 Jan 2012 13:39:13 +0000 Subject: [PATCH] Don't Close() directories because they are only Lock()ed but not Open()ed. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@43693 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- compiler/clib/close.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/clib/close.c b/compiler/clib/close.c index b758c62692..6bf1c8507c 100644 --- a/compiler/clib/close.c +++ b/compiler/clib/close.c @@ -79,7 +79,15 @@ if (!(fdesc->fcb->privflags & _FCB_DONTCLOSE_FH)) { - (void)Close(fdesc->fcb->fh); + // don't close directories because we don't Open() them. + if (fdesc->fcb->isdir) + { + UnLock(fdesc->fcb->fh); + } + else + { + Close(fdesc->fcb->fh); + } } FreeVec(fdesc->fcb); -- 2.11.4.GIT