consistent error check

This commit is contained in:
Connor Lane Smith
2011-06-04 12:20:41 +01:00
parent de221bc6f5
commit d90ced2047
13 changed files with 22 additions and 22 deletions

View File

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