From ce2ec19c56d646656e64a4b8e0279820337f089e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20Br=C3=BCns?= Date: Sat, 1 Oct 2016 20:41:39 +0200 Subject: [PATCH] sandbox/fs: Make linking of nodes in os_dirent_ls more obvious MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously, after reading/creating the second dirent, the second entry would be chained to the first entry and the first entry would be linked to head. Instead, immediately link the first entry to head. Signed-off-by: Stefan Brüns Acked-by: Simon Glass --- arch/sandbox/cpu/os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 2d63dd88f1..c71882a731 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -363,8 +363,8 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp) next->size = buf.st_size; if (node) node->next = next; - if (!head) - head = node; + else + head = next; } *headp = head; -- 2.39.5