summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-03-04 19:59:11 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-03-05 16:28:05 +0100
commit32ee1f61b692b94047c30da71dd9a292bbcb22a3 (patch)
treec7eaa555f9ac658fccb4e45a836a75681724e89b
parent4a3f29461bab7b4e7c6758019b961ce30d808812 (diff)
downloadbarebox-32ee1f61b692.tar.gz
barebox-32ee1f61b692.tar.xz
fs: fix unreaddir, so readdir returns unread dirent first
unreaddir should return a directory entry at the top of the list, so readdir consumes it again, not at the end. Fixes: 7876018f7333 ("fs: implement unreaddir") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-27-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--fs/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fs.c b/fs/fs.c
index b3eac2e55a..bd2f0b6294 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1024,7 +1024,7 @@ int unreaddir(DIR *dir, const struct dirent *d)
entry = xzalloc(sizeof(*entry));
entry->d = *d;
- list_add_tail(&entry->list, &dir->entries);
+ list_add(&entry->list, &dir->entries);
return 0;
}