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:
parent
0941c9ab2c
commit
36a0a6cd92
5
touch.c
5
touch.c
|
@ -21,14 +21,13 @@ touch(const char *file)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int r;
|
|
||||||
|
|
||||||
if ((r = stat(file, &st)) < 0) {
|
if (stat(file, &st) < 0) {
|
||||||
if (errno != ENOENT)
|
if (errno != ENOENT)
|
||||||
eprintf("stat %s:", file);
|
eprintf("stat %s:", file);
|
||||||
if (cflag)
|
if (cflag)
|
||||||
return;
|
return;
|
||||||
} else if (!r) {
|
} else {
|
||||||
if (!aflag)
|
if (!aflag)
|
||||||
times[0] = st.st_atim;
|
times[0] = st.st_atim;
|
||||||
if (!mflag)
|
if (!mflag)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user