SCCS-vsn: usr.bin/touch/touch.c 5.3
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)touch.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)touch.c 5.3 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
+ /*
+ * System V and POSIX 1003.1 require that a NULL argument
+ * set the access/modification times to the current time.
+ * The permission checks are different, too, in that the
+ * ability to write the file is sufficient. Take a shot.
+ */
+ if (!utimes(*argv, NULL))
+ continue;
+
/* Try reading/writing. */
if (rw(*argv, &sb, fflag))
rval = 1;
/* Try reading/writing. */
if (rw(*argv, &sb, fflag))
rval = 1;