# HG changeset patch # User Marcel Telka # Date 1257284746 -3600 # Node ID 343d43cca32b456f79f86768b1b13d06c3ca91bd # Parent 270624bd70f1881099159768502bd4294e49b7c7 6897583 touch(1) calls both futimens(2) and utimensat(2) on newly created files diff -r 270624bd70f1 -r 343d43cca32b usr/src/cmd/touch/touch.c --- a/usr/src/cmd/touch/touch.c Tue Nov 03 11:02:16 2009 -0700 +++ b/usr/src/cmd/touch/touch.c Tue Nov 03 22:45:46 2009 +0100 @@ -239,7 +239,7 @@ } if ((fd >= 0 && futimens(fd, tsp) != 0) || - utimensat(AT_FDCWD, argv[c], tsp, 0) != 0) { + (fd < 0 && utimensat(AT_FDCWD, argv[c], tsp, 0) != 0)) { (void) fprintf(stderr, gettext("%s: cannot change times on %s: %s\n"), myname, argv[c], strerror(errno));