summaryrefslogtreecommitdiff
path: root/src/user/test
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 19:40:11 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 19:40:11 +0200
commitac10c1a29c44b0cb29960cd0f792c7361bc430ce (patch)
tree33466e227a0214d40de373b72c83a750dba29195 /src/user/test
parent478c691187fbc9ba4ccaacf92f57828eef20041c (diff)
downloadTCE-ac10c1a29c44b0cb29960cd0f792c7361bc430ce.tar.gz
TCE-ac10c1a29c44b0cb29960cd0f792c7361bc430ce.zip
Added some stuff.
Diffstat (limited to 'src/user/test')
-rw-r--r--src/user/test/main.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/user/test/main.c b/src/user/test/main.c
index 411cc71..3457ac3 100644
--- a/src/user/test/main.c
+++ b/src/user/test/main.c
@@ -4,8 +4,6 @@
int threads = 0;
-FILE out = 0;
-
void thread_cascade(void* d) {
int n = (int)d;
@@ -47,30 +45,30 @@ void list_dir(FILE f, int lv) {
i++;
continue;
}
- for (k = 0; k < lv; k++) fprint(out, " ");
- fprint(out, buf);
+ for (k = 0; k < lv; k++) print(" ");
+ print(buf);
stat_relative(f, buf, &info);
- if (info.type & FT_DIR) fprint(out, "/");
- fprint(out, " \t");
+ if (info.type & FT_DIR) print("/");
+ print(" \t");
- if (info.type & FT_FILE) fprint(out, "file ");
- if (info.type & FT_DIR) fprint(out, "dir ");
- if (info.type & FT_SYMLINK) fprint(out, "symlink ");
- if (info.type & FT_DEV) fprint(out, "dev ");
- if (info.type & FT_TERMINAL) fprint(out, "term ");
+ 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) {
- fprint(out, " \t");
+ print(" \t");
FILE ff = open_relative(f, buf, 0);
if (ff <= 0) {
- fprintf(out, "error: %i\n", ff);
+ printf("error: %i\n", ff);
} else {
- fprintf(out, "fd: %i\n", ff);
+ printf("fd: %i\n", ff);
list_dir(ff, lv+1);
close(ff);
}
} else {
- fprint(out, "\n");
+ print("\n");
}
i++;
}
@@ -79,9 +77,9 @@ void list_dir(FILE f, int lv) {
void list_root() {
FILE f = open("/", 0);
if (f <= 0) {
- fprintf(out, " -> Could not open '/', error #%i\n", f);
+ printf(" -> Could not open '/', error #%i\n", f);
} else {
- fprintf(out, "Now enumerating '/' (fd %i) :\n", f);
+ printf("Now enumerating '/' (fd %i) :\n", f);
list_dir(f, 1);
close(f);
}
@@ -107,7 +105,7 @@ int main(char** args) {
}
printk("\n");
- out = open("/.ui/klog", 0);
+ term = open("/.ui/klog", 0);
list_root();
return 0;