From: Junio C Hamano Date: Sat, 12 Sep 2009 05:09:12 GMT Subject: Re: [PATCH] preserve mtime of local clone Message-ID: <7vmy50lpfr.fsf@alter.siamese.dyndns.org> In-Reply-To: <20090909195158.GA12968@localhost> Clemens Buchacher writes: > +int copy_times(int ofd, int ifd) > +{ > + struct stat st; > + struct timespec times[2]; > + if (fstat(ifd, &st)) > + return -1; > + times[0].tv_nsec = UTIME_OMIT; > + times[1].tv_sec = st.st_mtime; > + times[1].tv_nsec = ST_MTIME_NSEC(st); > + return futimens(ofd, times); > +} Hmm, futimens() is relatively new. Are minority platforms folks Ok with this patch? At least SunOS 5.11 (OpenSolaris 0811) seems to barf on UTIME_OMIT.