Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH] preserve mtime of local clone

From: Clemens Buchacher <hidden>
Date: 2016-06-15 22:47:23

Possibly related (same subject, not in this thread)

On Fri, Sep 11, 2009 at 10:09:12PM -0700, Junio C Hamano wrote:
Clemens Buchacher [off-list ref] writes:
quoted
+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.
If it's a problem we can use utime() instead. I was just trying to use the
file descriptors, since they were available. But the patch would be a little
smaller if I didn't touch copy_fd().

Clemens
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help