diff options
author | OYTIS <tossel@gmail.com> | 2017-02-23 18:13:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-23 18:13:56 +0300 |
commit | 9d4ca6ac00c3f004407f5ef03a708baecca82a93 (patch) | |
tree | ff4a65a54ac2e4ee10a0b93f683be55b115716e6 /recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch | |
parent | 7643e4da141c10bcb017d7a216512febe08da68a (diff) | |
parent | f38fc412321c9cb6c17110d8a8aa6183823b0122 (diff) | |
download | meta-updater-9d4ca6ac00c3f004407f5ef03a708baecca82a93.tar.gz |
Merge pull request #36 from advancedtelematic/feat/morty
Changes for morty branch (sync with AGL's meta-sota)
Diffstat (limited to 'recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch')
-rw-r--r-- | recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch b/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch deleted file mode 100644 index 3da2ad7..0000000 --- a/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | From 41bb6c818a7ec9eeb33b60302c55c9c5ee393c5f Mon Sep 17 00:00:00 2001 | ||
2 | From: Anton Gerasimov <anton@advancedtelematic.com> | ||
3 | Date: Fri, 30 Sep 2016 17:12:19 +0200 | ||
4 | Subject: [PATCH 1/1] Add check for existence of old file to renameat | ||
5 | |||
6 | --- | ||
7 | ports/unix/guts/renameat.c | 7 ++++++- | ||
8 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c | ||
11 | index ade0509..d5e36fa 100644 | ||
12 | --- a/ports/unix/guts/renameat.c | ||
13 | +++ b/ports/unix/guts/renameat.c | ||
14 | @@ -11,6 +11,7 @@ | ||
15 | int oldrc, newrc; | ||
16 | int save_errno; | ||
17 | int old_db_entry = 0; | ||
18 | + int may_unlinked = 0; | ||
19 | |||
20 | pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n", | ||
21 | olddirfd, oldpath ? oldpath : "<nil>", | ||
22 | @@ -44,10 +45,14 @@ | ||
23 | /* as with unlink, we have to mark that the file may get deleted */ | ||
24 | msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf); | ||
25 | if (msg && msg->result == RESULT_SUCCEED) | ||
26 | + may_unlinked = 1; | ||
27 | + msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf); | ||
28 | + if (msg && msg->result == RESULT_SUCCEED) | ||
29 | old_db_entry = 1; | ||
30 | + | ||
31 | rc = real_renameat(olddirfd, oldpath, newdirfd, newpath); | ||
32 | save_errno = errno; | ||
33 | - if (old_db_entry) { | ||
34 | + if (may_unlinked) { | ||
35 | if (rc == -1) { | ||
36 | /* since we failed, that wasn't really unlinked -- put | ||
37 | * it back. | ||
38 | -- | ||
39 | 2.9.3 | ||
40 | |||