summaryrefslogtreecommitdiff
path: root/src/user/test/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/test/main.c')
-rw-r--r--src/user/test/main.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/src/user/test/main.c b/src/user/test/main.c
index 3457ac3..7ca4802 100644
--- a/src/user/test/main.c
+++ b/src/user/test/main.c
@@ -34,57 +34,6 @@ void thread_cascade(void* d) {
threads--;
}
-void list_dir(FILE f, int lv) {
- char buf[256];
- int i = 0, k;
- int r;
- file_info info;
-
- while ((r = read(f, i, 256, buf)) > 0) {
- if (strcmp(buf, ".") == 0 || strcmp(buf, "..") == 0) {
- i++;
- continue;
- }
- for (k = 0; k < lv; k++) print(" ");
- print(buf);
- stat_relative(f, buf, &info);
- if (info.type & FT_DIR) print("/");
- print(" \t");
-
- if (info.type & FT_FILE) print("file ");
- if (info.type & FT_DIR) print("dir ");
- if (info.type & FT_SYMLINK) print("symlink ");
- if (info.type & FT_DEV) print("dev ");
- if (info.type & FT_TERMINAL) print("term ");
-
- if (info.type & FT_DIR) {
- print(" \t");
- FILE ff = open_relative(f, buf, 0);
- if (ff <= 0) {
- printf("error: %i\n", ff);
- } else {
- printf("fd: %i\n", ff);
- list_dir(ff, lv+1);
- close(ff);
- }
- } else {
- print("\n");
- }
- i++;
- }
-}
-
-void list_root() {
- FILE f = open("/", 0);
- if (f <= 0) {
- printf(" -> Could not open '/', error #%i\n", f);
- } else {
- printf("Now enumerating '/' (fd %i) :\n", f);
- list_dir(f, 1);
- close(f);
- }
-}
-
int main(char** args) {
char**a;
if (args != 0) {
@@ -103,10 +52,7 @@ int main(char** args) {
thread_sleep(100);
if (threads == 0) break;
}
- printk("\n");
-
- term = open("/.ui/klog", 0);
- list_root();
+ printk("\n -> Test process exiting. Press the super key to go to the home terminal.\n");
return 0;
}