From 633feeea57c298306d8664c9c2768ab46fb7c6f4 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Wed, 11 Dec 2024 18:47:33 +0100 Subject: signal: Remove old way of sending signals and instead use procfs --- userland/minibox/utilities/ls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'userland/minibox/utilities/ls.c') diff --git a/userland/minibox/utilities/ls.c b/userland/minibox/utilities/ls.c index 0ce70f8..5a8f8ea 100644 --- a/userland/minibox/utilities/ls.c +++ b/userland/minibox/utilities/ls.c @@ -20,10 +20,16 @@ int ls_main(int argc, char **argv) { newline = 1; break; }*/ + char *path = argv[1]; + char path_buffer[256]; + + if (!path) { + (void)getcwd(path_buffer, 256); + path = path_buffer; + } + struct dirent **namelist; int n; - char path[256]; - (void)getcwd(path, 256); COND_PERROR_EXP(-1 == (n = scandir(path, &namelist, 0, 0)), "scandir", return 1); -- cgit v1.2.3