summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-02-05 12:48:46 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2019-02-05 12:50:05 +0100
commite435312f0692996232fc12786be59513a2536489 (patch)
tree6aa5df484ba4c9ba77ce7e30702cdd6a3d96cb89 /methods
parent7775e430c0b17e285a612c115b4d138759761e65 (diff)
aptmethod.h: Do not have gcc warning about ignoring write() result
This is a special case here, a best effort write, so there's no point in having warnings about it for every method.
Diffstat (limited to 'methods')
-rw-r--r--methods/aptmethod.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/methods/aptmethod.h b/methods/aptmethod.h
index f6613ac3b..02ef04cf9 100644
--- a/methods/aptmethod.h
+++ b/methods/aptmethod.h
@@ -339,11 +339,18 @@ protected:
constexpr const char *str1 = "\n **** Seccomp prevented execution of syscall ";
constexpr const char *str2 = " on architecture ";
constexpr const char *str3 = " ****\n";
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-result"
+#endif
write(2, str1, strlen(str1));
write(2, buffer, sizeof(buffer));
write(2, str2, strlen(str2));
write(2, COMMON_ARCH, strlen(COMMON_ARCH));
write(2, str3, strlen(str3));
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
_exit(31);
};
action.sa_flags = SA_SIGINFO;