[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a)
From: |
Rtp |
Subject: |
[Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a) |
Date: |
Tue, 21 Apr 2009 10:24:03 +0200 |
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 <address@hidden>
---
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>
- [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a),
Rtp <=