summaryrefslogtreecommitdiffstats
path: root/commands/ls.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/ls.c')
-rw-r--r--commands/ls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/ls.c b/commands/ls.c
index c98d2dad57..ad609f3133 100644
--- a/commands/ls.c
+++ b/commands/ls.c
@@ -49,7 +49,7 @@ int ls(const char *path, ulong flags)
string_list_init(&sl);
if (stat(path, &s))
- return errno;
+ return -errno;
if (flags & LS_SHOWARG && s.st_mode & S_IFDIR)
printf("%s:\n", path);
@@ -61,7 +61,7 @@ int ls(const char *path, ulong flags)
dir = opendir(path);
if (!dir)
- return errno;
+ return -errno;
while ((d = readdir(dir))) {
sprintf(tmp, "%s/%s", path, d->d_name);
@@ -85,7 +85,7 @@ int ls(const char *path, ulong flags)
dir = opendir(path);
if (!dir) {
- errno = -ENOENT;
+ errno = ENOENT;
return -ENOENT;
}