add rm, thanks rob

This commit is contained in:
Connor Lane Smith
2011-05-24 01:52:28 +01:00
parent 9714d7b1d3
commit 8c76381e91
5 changed files with 79 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ touch(const char *str)
struct stat st;
struct utimbuf ut;
if(stat(str, &st) < 0) {
if(stat(str, &st) != 0) {
if(errno != ENOENT)
eprintf("stat %s:", str);
if(cflag)
@@ -54,6 +54,6 @@ touch(const char *str)
}
ut.actime = st.st_atime;
ut.modtime = t;
if(utime(str, &ut) < 0)
if(utime(str, &ut) != 0)
eprintf("utime %s:", str);
}