diff options
Diffstat (limited to 'user/ls.c')
-rw-r--r-- | user/ls.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } |