summaryrefslogtreecommitdiff
path: root/user/ls.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2019-08-27 13:13:03 -0400
committerRobert Morris <[email protected]>2019-08-27 13:13:03 -0400
commit64b93d175ac6eb739036b394fbb0766fbf06f5b7 (patch)
tree7914971346f770276a307763449700353a5003c1 /user/ls.c
parenta3f6d9fd1e21a7339f2bc26f185f7d561bc370c4 (diff)
downloadxv6-labs-64b93d175ac6eb739036b394fbb0766fbf06f5b7.tar.gz
xv6-labs-64b93d175ac6eb739036b394fbb0766fbf06f5b7.tar.bz2
xv6-labs-64b93d175ac6eb739036b394fbb0766fbf06f5b7.zip
user printf(1 -> printf(
Diffstat (limited to 'user/ls.c')
-rw-r--r--user/ls.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/user/ls.c b/user/ls.c
index 3511d87..5847555 100644
--- a/user/ls.c
+++ b/user/ls.c
@@ -31,24 +31,24 @@ ls(char *path)
struct stat st;
if((fd = open(path, 0)) < 0){
- printf(2, "ls: cannot open %s\n", path);
+ fprintf(2, "ls: cannot open %s\n", path);
return;
}
if(fstat(fd, &st) < 0){
- printf(2, "ls: cannot stat %s\n", path);
+ fprintf(2, "ls: cannot stat %s\n", path);
close(fd);
return;
}
switch(st.type){
case T_FILE:
- printf(1, "%s %d %d %l\n", fmtname(path), st.type, st.ino, st.size);
+ printf("%s %d %d %l\n", fmtname(path), st.type, st.ino, st.size);
break;
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
- printf(1, "ls: path too long\n");
+ printf("ls: path too long\n");
break;
}
strcpy(buf, path);
@@ -60,10 +60,10 @@ ls(char *path)
memmove(p, de.name, DIRSIZ);
p[DIRSIZ] = 0;
if(stat(buf, &st) < 0){
- printf(1, "ls: cannot stat %s\n", buf);
+ printf("ls: cannot stat %s\n", buf);
continue;
}
- printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
+ printf("%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
}
break;
}