qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a)
@ 2009-04-21  8:24 Arnaud Patard
  2009-04-21  8:36 ` Laurent Desnogues
  2009-04-21 12:34 ` Riku Voipio
  0 siblings, 2 replies; 7+ messages in thread
From: Arnaud Patard @ 2009-04-21  8:24 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]



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 <arnaud.patard@rtp-net.org>
---

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: utimensat.patch --]
[-- Type: text/x-diff, Size: 1025 bytes --]

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 <sys/inotify.h>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-04-21 18:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21  8:24 [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a) Arnaud Patard
2009-04-21  8:36 ` Laurent Desnogues
2009-04-21 12:34 ` Riku Voipio
2009-04-21 14:42   ` Jamie Lokier
2009-04-21 16:09   ` Martin Mohring
2009-04-21 16:38     ` Martin Mohring
2009-04-21 18:18       ` Riku Voipio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).