summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch36
1 files changed, 23 insertions, 13 deletions
diff --git a/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch b/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
index 8d9a50a697..b755a263a4 100644
--- a/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
+++ b/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
@@ -14,11 +14,11 @@ Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
14 src/patchelf.cc | 16 +++++++++++++++- 14 src/patchelf.cc | 16 +++++++++++++++-
15 1 file changed, 15 insertions(+), 1 deletion(-) 15 1 file changed, 15 insertions(+), 1 deletion(-)
16 16
17diff --git a/src/patchelf.cc b/src/patchelf.cc 17Index: git/src/patchelf.cc
18index 1aeae88..6b77afe 100644 18===================================================================
19--- a/src/patchelf.cc 19--- git.orig/src/patchelf.cc
20+++ b/src/patchelf.cc 20+++ git/src/patchelf.cc
21@@ -534,9 +534,19 @@ void ElfFile<ElfFileParamNames>::sortShdrs() 21@@ -534,9 +534,19 @@ void ElfFile<ElfFileParamNames>::sortShd
22 22
23 static void writeFile(const std::string & fileName, const FileContents & contents) 23 static void writeFile(const std::string & fileName, const FileContents & contents)
24 { 24 {
@@ -39,17 +39,27 @@ index 1aeae88..6b77afe 100644
39 if (fd == -1) 39 if (fd == -1)
40 error("open"); 40 error("open");
41 41
42@@ -564,6 +574,10 @@ static void writeFile(const std::string & fileName, const FileContents & content 42@@ -551,8 +561,6 @@ static void writeFile(const std::string
43 if (errno == EINTR) 43 bytesWritten += portion;
44 return; 44 }
45 error("close"); 45
46- if (close(fd) >= 0)
47- return;
48 /*
49 * Just ignore EINTR; a retry loop is the wrong thing to do.
50 *
51@@ -561,9 +569,11 @@ static void writeFile(const std::string
52 * http://utcc.utoronto.ca/~cks/space/blog/unix/CloseEINTR
53 * https://sites.google.com/site/michaelsafyan/software-engineering/checkforeintrwheninvokingclosethinkagain
54 */
55- if (errno == EINTR)
56- return;
57- error("close");
58+ if ((close(fd) < 0) && errno != EINTR)
59+ error("close");
46+ 60+
47+ if (chmod(fileName.c_str(), st.st_mode) != 0) 61+ if (chmod(fileName.c_str(), st.st_mode) != 0)
48+ error("chmod"); 62+ error("chmod");
49+
50 } 63 }
51 64
52 65
53--
542.25.1
55