touch: Remove useless variable
The only possible return values of stat are 0 or -1, so it doesn't make sense to store the return value in a variable to make sure it is not positive.
This commit is contained in:
@@ -21,14 +21,13 @@ touch(const char *file)
|
||||
{
|
||||
int fd;
|
||||
struct stat st;
|
||||
int r;
|
||||
|
||||
if ((r = stat(file, &st)) < 0) {
|
||||
if (stat(file, &st) < 0) {
|
||||
if (errno != ENOENT)
|
||||
eprintf("stat %s:", file);
|
||||
if (cflag)
|
||||
return;
|
||||
} else if (!r) {
|
||||
} else {
|
||||
if (!aflag)
|
||||
times[0] = st.st_atim;
|
||||
if (!mflag)
|
||||
|
||||
Reference in New Issue
Block a user