From 77ac1468fda468be45651ed3ac4cc7838e8cf9af Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Tue, 1 Dec 2015 15:15:12 -0800 Subject: [PATCH] Improve logging for shell and fs --- bin/shell/shell.c | 5 +++++ sys/fs/o2fs/o2fs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/shell/shell.c b/bin/shell/shell.c index 06908e2..1304bd2 100644 --- a/bin/shell/shell.c +++ b/bin/shell/shell.c @@ -6,6 +6,7 @@ // Castor Only #include +#include #include #define SHELL_MAX_ARGS 5 @@ -138,6 +139,10 @@ Cmd_Spawn(int argc, const char *argv[]) printf("%s\n", argv[1]); status = OSSpawn(argv[1]); + if (SYSCALL_ERRCODE(status) != 0) { + printf("Spawn failed: %d\n", status); + return; + } // XXX: check errors status = OSWait(status); printf("Process result: %d\n", status); diff --git a/sys/fs/o2fs/o2fs.c b/sys/fs/o2fs/o2fs.c index f813a9a..bb04de7 100644 --- a/sys/fs/o2fs/o2fs.c +++ b/sys/fs/o2fs/o2fs.c @@ -363,7 +363,7 @@ O2FS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off) status = O2FS_Read(fn, &dirEntry, *off, sizeof(dirEntry)); if (status != sizeof(dirEntry)) { - kprintf("Unexpected error reading directory."); + kprintf("Unexpected error reading directory: %d", status); return status; }