diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-03-04 19:59:11 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-03-05 16:28:05 +0100 |
commit | 32ee1f61b692b94047c30da71dd9a292bbcb22a3 (patch) | |
tree | c7eaa555f9ac658fccb4e45a836a75681724e89b | |
parent | 4a3f29461bab7b4e7c6758019b961ce30d808812 (diff) | |
download | barebox-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } |