Re: [PATCH] preserve mtime of local clone
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 12, 2009, 05:09 UTC
- Message-ID
- <7vmy50lpfr.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20090909195158.GA12968@localhost>
Clemens Buchacher <drizzd@aon.at> writes:
Show 11 quoted lines
> +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.