From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a)
Date: Tue, 21 Apr 2009 10:24:03 +0200 [thread overview]
Message-ID: <878wlufm8s.fsf@lechat.rtp-net.org> (raw)
[-- 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>
next reply other threads:[~2009-04-21 8:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-21 8:24 Arnaud Patard [this message]
2009-04-21 8:36 ` [Qemu-devel] [PATCH] Fix utimensat (aka unbreak cp -a) 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878wlufm8s.fsf@lechat.rtp-net.org \
--to=arnaud.patard@rtp-net.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).