← Commit list

d156bcf71

Denys Vlasenko
Denys Vlasenko
2021-04-14
SUCCESS Duration: 152s

Subject

touch: code shrink

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/touch.c+4 -6
@@ -156,12 +156,10 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
/* If both -a and -m specified, both times should be set.
* IOW: set OMIT only if one, not both, of them is given!
*/
- if ((opts & (OPT_a|OPT_m)) != (OPT_a|OPT_m)) {
- if (opts & OPT_a)
- timebuf[1].tv_nsec = UTIME_OMIT;
- if (opts & OPT_m)
- timebuf[0].tv_nsec = UTIME_OMIT;
- }
+ if ((opts & (OPT_a|OPT_m)) == OPT_a)
+ timebuf[1].tv_nsec = UTIME_OMIT;
+ if ((opts & (OPT_a|OPT_m)) == OPT_m)
+ timebuf[0].tv_nsec = UTIME_OMIT;
argv += optind;
do {