aboutsummaryrefslogtreecommitdiffstats
path: root/com32/rosh/rosh.c
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-10-02 00:18:27 -0400
committerGene Cumm <gene.cumm@gmail.com>2010-10-09 07:33:07 -0400
commitb3b0fa7ce9bcdc6c5f25ef9ed47dab23ac4c8d01 (patch)
tree8e74a278b2d0f1bbf4f78683bd4fe70af48b3348 /com32/rosh/rosh.c
parentadac922714ec5835812fe8902d17eb0c5f0ff316 (diff)
downloadsyslinux-b3b0fa7ce9bcdc6c5f25ef9ed47dab23ac4c8d01.tar.gz
syslinux-b3b0fa7ce9bcdc6c5f25ef9ed47dab23ac4c8d01.tar.xz
syslinux-b3b0fa7ce9bcdc6c5f25ef9ed47dab23ac4c8d01.zip
rosh: closedir() only if actually opened
Diffstat (limited to 'com32/rosh/rosh.c')
-rw-r--r--com32/rosh/rosh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c
index f5ed6cd3..8d063e6b 100644
--- a/com32/rosh/rosh.c
+++ b/com32/rosh/rosh.c
@@ -780,11 +780,11 @@ void rosh_ls_arg(const char *filestr, const int *optarr)
ROSH_DEBUG("PATH '%s' is a directory\n", filestr);
if (d = opendir(filestr)) {
rosh_ls_arg_dir(filestr, d, optarr);
+ closedir(d);
} else {
rosh_error(errno, "ls", filestr);
errno = 0;
}
- closedir(d);
} else {
de.d_ino = rosh_ls_d_ino(&fdstat);
de.d_type = (IFTODT(fdstat.st_mode));