From c91f19ab989cbafb0a0fe47613c34fd33acf7cc4 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 4 Jun 2015 18:11:29 +0100 Subject: [PATCH] readdir: don't loop on error --- Library/libs/readdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/libs/readdir.c b/Library/libs/readdir.c index a25c2737..924e6633 100644 --- a/Library/libs/readdir.c +++ b/Library/libs/readdir.c @@ -13,7 +13,7 @@ static struct __dirent *dnext(struct _dir *dir) { if (dir->next == dir->last) { int l = read(dir->d.dd_fd, dir->buf, sizeof(dir->buf)); - if (l == 0) + if (l <= 0) return NULL; l /= 32; dir->last = l; -- 2.34.1