From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwB9v-0003G7-V1 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 04:16:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwB9u-0003Fg-Pt for qemu-devel@nongnu.org; Tue, 21 Apr 2009 04:16:51 -0400 Received: from [199.232.76.173] (port=40077 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwB9u-0003Fb-Ly for qemu-devel@nongnu.org; Tue, 21 Apr 2009 04:16:50 -0400 Received: from mx20.gnu.org ([199.232.41.8]:55488) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwB9u-0000lu-7Q for qemu-devel@nongnu.org; Tue, 21 Apr 2009 04:16:50 -0400 Received: from lechat.rtp-net.org ([88.191.19.38]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LwB9t-0005v4-Hz for qemu-devel@nongnu.org; Tue, 21 Apr 2009 04:16:49 -0400 Received: from lechat.rtp-net.org (localhost [127.0.0.1]) by lechat.rtp-net.org (Postfix) with ESMTP id B38E510087 for ; Tue, 21 Apr 2009 10:24:03 +0200 (CEST) From: Arnaud Patard (Rtp) Date: Tue, 21 Apr 2009 10:24:03 +0200 Message-ID: <878wlufm8s.fsf@lechat.rtp-net.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-=-= Don't use the glibc function for utimensat because glibc returns -EINVAL if the path is null which is a different behaviour with the syscall. path can be null because internally the glibc is using utimensat with path null (for instance, see __futimes in sysdeps/unix/sysv/linux/futimes.c in glibc tree). Signed-off-by: Arnaud Patard --- --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=utimensat.patch diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b6dc6cc..6959da0 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -412,13 +412,6 @@ static int sys_unlinkat(int dirfd, const char *pathname, int flags) return (unlinkat(dirfd, pathname, flags)); } #endif -#ifdef TARGET_NR_utimensat -static int sys_utimensat(int dirfd, const char *pathname, - const struct timespec times[2], int flags) -{ - return (utimensat(dirfd, pathname, times, flags)); -} -#endif #else /* !CONFIG_ATFILE */ /* @@ -478,12 +471,12 @@ _syscall3(int,sys_symlinkat,const char *,oldpath, #if defined(TARGET_NR_unlinkat) && defined(__NR_unlinkat) _syscall3(int,sys_unlinkat,int,dirfd,const char *,pathname,int,flags) #endif +#endif /* CONFIG_ATFILE */ #if defined(TARGET_NR_utimensat) && defined(__NR_utimensat) _syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, const struct timespec *,tsp,int,flags) #endif -#endif /* CONFIG_ATFILE */ #ifdef CONFIG_INOTIFY #include --=-=-=--