summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2017-08-31 19:08:49 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2017-08-31 19:08:49 -0400
commit0e7f9a71d62abba31357b842825d38fd3fa3f18b (patch)
tree1ec6316cb81e16a5c9c4c169f441de7dc3ce71f4
parentb37fef52049e3d9b32d73eb6db3e9058d875fd9a (diff)
downloadefi-boot-shim-0e7f9a71d62abba31357b842825d38fd3fa3f18b.tar.gz
efi-boot-shim-0e7f9a71d62abba31357b842825d38fd3fa3f18b.zip
debian/patches/buildid_write_return.patch: workaround our strict compile rules failing the build: make sure write calls check the return value.
-rw-r--r--debian/changelog2
-rw-r--r--debian/patches/buildid_write_return.patch35
-rw-r--r--debian/patches/series1
3 files changed, 38 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 830e763d..806465b0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,8 @@ shim (12+1503074702.5202f80-0ubuntu1~test3) artful; urgency=medium
* debian/rules: clean up after *.signed files.
* debian/shim.install: update paths in light of using shim's upstream install
target.
+ * debian/patches/buildid_write_return.patch: workaround our strict compile
+ rules failing the build: make sure write calls check the return value.
-- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Tue, 29 Aug 2017 22:45:30 -0400
diff --git a/debian/patches/buildid_write_return.patch b/debian/patches/buildid_write_return.patch
new file mode 100644
index 00000000..268cbd33
--- /dev/null
+++ b/debian/patches/buildid_write_return.patch
@@ -0,0 +1,35 @@
+---
+ buildid.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+Index: b/buildid.c
+===================================================================
+--- a/buildid.c
++++ b/buildid.c
+@@ -113,6 +113,7 @@ static void handle_one(char *f)
+ char *b = NULL;
+ size_t sz;
+ uint8_t *data;
++ ssize_t written;
+
+ if (!strcmp(f, "-")) {
+ fd = STDIN_FILENO;
+@@ -132,10 +133,14 @@ static void handle_one(char *f)
+ b = alloca(sz * 2 + 1);
+ data2hex(data, sz, b);
+ if (b) {
+- write(1, f, strlen(f));
+- write(1, " ", 1);
+- write(1, b, strlen(b));
+- write(1, "\n", 1);
++ written = write(1, f, strlen(f));
++ if (written < 0)
++ errx(1, "Error writing build id");
++ written = write(1, " ", 1);
++ written = write(1, b, strlen(b));
++ if (written < 0)
++ errx(1, "Error writing build id");
++ written = write(1, "\n", 1);
+ }
+ }
+ elf_end(elf);
diff --git a/debian/patches/series b/debian/patches/series
index 268dc0e6..0f0fda43 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
fix_makefile_phony.patch
+buildid_write_return.patch