aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 976b3343..d24168d6 100644
--- a/toys/posix/ls.c
+++ b/toys/posix/ls.c
@@ -169,6 +169,8 @@ static int compare(void *a, void *b)
if (toys.optflags & FLAG_t) {
if (dta->st.st_mtime > dtb->st.st_mtime) ret = -1;
else if (dta->st.st_mtime < dtb->st.st_mtime) ret = 1;
+ else if (dta->st.st_mtim.tv_nsec > dtb->st.st_mtim.tv_nsec) ret = -1;
+ else if (dta->st.st_mtim.tv_nsec < dtb->st.st_mtim.tv_nsec) ret = 1;
}
if (!ret) ret = strcmp(dta->name, dtb->name);
return ret * reverse;