summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/files
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-10-06 16:45:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-07 16:43:57 +0100
commit0623259559f3160ce426ca9eecfd145711bfd016 (patch)
tree1aec8eaf16f9d17b995dea78fb33335667cc72cb /meta/recipes-devtools/pseudo/files
parente96af0c0b9a11234cd1f0c75ebe1dfec3e59c183 (diff)
downloadpoky-0623259559f3160ce426ca9eecfd145711bfd016.tar.gz
pseudo: backport a patch to fix renameat()
renameat calls under pseudo were losing extended attributes. Backport the fix for this from pseudo upstream. [YOCTO '10349] (From OE-Core rev: 16f6b020ebea49f012f2e65997a8d464f94d6605) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/pseudo/files')
-rw-r--r--meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch b/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
new file mode 100644
index 0000000000..739c03ee6e
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch
@@ -0,0 +1,64 @@
1From d9ab3a0acc94151048498b1ea4d69e7707df1526 Mon Sep 17 00:00:00 2001
2From: Seebs <seebs@seebs.net>
3Date: Fri, 30 Sep 2016 10:56:35 -0500
4Subject: [PATCH 3/3] Fix renameat (parallel to previous fix to rename)
5
6There was a bug in rename(), which was duplicated when renameat() was
7implemented, and which got fixed two years ago for rename(), but no
8one ever uses renameat() so it didn't get fixed there. Thanks
9to Anton Gerasimov <anton@advancedtelematic.com> for the bug report
10and patch.
11
12Signed-off-by: Seebs <seebs@seebs.net>
13
14Upstream-Status: Backport
15Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
16
17---
18 ChangeLog.txt | 4 ++++
19 ports/unix/guts/renameat.c | 7 ++++++-
20 2 files changed, 10 insertions(+), 1 deletion(-)
21
22diff --git a/ChangeLog.txt b/ChangeLog.txt
23index 65b9759..ca04cc0 100644
24--- a/ChangeLog.txt
25+++ b/ChangeLog.txt
26@@ -1,3 +1,7 @@
27+2016-09-30:
28+ * (seebs) Fix rename at, matching fix from ee00f63d for rename. Bug
29+ and fix provided by Anton Gerasimov <anton@advancedtelematic.com>.
30+
31 2016-09-28:
32 * (seebs) Send errors to log when daemonizing, but do that a lot
33 sooner to prevent startup messages which can show up spuriously
34diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c
35index ade0509..d5e36fa 100644
36--- a/ports/unix/guts/renameat.c
37+++ b/ports/unix/guts/renameat.c
38@@ -11,6 +11,7 @@
39 int oldrc, newrc;
40 int save_errno;
41 int old_db_entry = 0;
42+ int may_unlinked = 0;
43
44 pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n",
45 olddirfd, oldpath ? oldpath : "<nil>",
46@@ -44,10 +45,14 @@
47 /* as with unlink, we have to mark that the file may get deleted */
48 msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf);
49 if (msg && msg->result == RESULT_SUCCEED)
50+ may_unlinked = 1;
51+ msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf);
52+ if (msg && msg->result == RESULT_SUCCEED)
53 old_db_entry = 1;
54+
55 rc = real_renameat(olddirfd, oldpath, newdirfd, newpath);
56 save_errno = errno;
57- if (old_db_entry) {
58+ if (may_unlinked) {
59 if (rc == -1) {
60 /* since we failed, that wasn't really unlinked -- put
61 * it back.
62--
632.7.4
64