diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2016-10-01 18:41:39 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-10-11 16:17:07 (GMT) |
commit | ce2ec19c56d646656e64a4b8e0279820337f089e (patch) | |
tree | dc7922717bbd4e5f911f4f484ae7fe4289e8eb45 | |
parent | 86167089b71c6b701194604e3dc66a67c6ea076a (diff) | |
download | u-boot-ce2ec19c56d646656e64a4b8e0279820337f089e.tar.xz |
sandbox/fs: Make linking of nodes in os_dirent_ls more obvious
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 <stefan.bruens@rwth-aachen.de>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/sandbox/cpu/os.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 2d63dd8..c71882a 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; |