diff options
author | Mike Frysinger <vapier@chromium.org> | 2017-02-06 21:27:59 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2017-02-08 05:50:30 +0000 |
commit | 8b0a1053e26e7a92da45ed4edd9e5df4fd574bc5 (patch) | |
tree | 58cf339061fffdc194dd6226aaeb0e7e93001807 /src | |
parent | Fixed leak of unloaded module lists. (diff) | |
download | breakpad-8b0a1053e26e7a92da45ed4edd9e5df4fd574bc5.tar.xz |
fix write() unused-result warning
src/client/linux/microdump_writer/microdump_writer_unittest.cc:98:47: error:
ignoring return value of 'ssize_t write(int, const void*, size_t)',
declared with attribute warn_unused_result [-Werror=unused-result]
write(STDOUT_FILENO, identifiable_string, 0);
Change-Id: I3f2305fbec0dbd1464de9aeff051e7cba2ee69a2
Reviewed-on: https://chromium-review.googlesource.com/438545
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/client/linux/microdump_writer/microdump_writer_unittest.cc | 2 | ||||
-rw-r--r-- | src/client/mac/tests/exception_handler_test.cc | 5 | ||||
-rw-r--r-- | src/client/mac/tests/minidump_generator_test.cc | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc index e5e6f448..cbcd1399 100644 --- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc +++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc @@ -95,7 +95,7 @@ void CrashAndGetMicrodump(const MappingList& mappings, // has been sanitized. strcpy(identifiable_string, kIdentifiableString); // Force the strcpy to not be optimized away. - write(STDOUT_FILENO, identifiable_string, 0); + IGNORE_RET(write(STDOUT_FILENO, identifiable_string, 0)); const pid_t child = fork(); if (child == 0) { diff --git a/src/client/mac/tests/exception_handler_test.cc b/src/client/mac/tests/exception_handler_test.cc index a8cf6968..d5b505a1 100644 --- a/src/client/mac/tests/exception_handler_test.cc +++ b/src/client/mac/tests/exception_handler_test.cc @@ -36,6 +36,7 @@ #include "breakpad_googletest_includes.h" #include "client/mac/handler/exception_handler.h" +#include "common/linux/ignore_ret.h" #include "common/mac/MachIPC.h" #include "common/tests/auto_tempdir.h" #include "google_breakpad/processor/minidump.h" @@ -93,7 +94,7 @@ static bool MDCallback(const char *dump_dir, const char *file_name, path.append(".dmp"); int fd = *reinterpret_cast<int*>(context); - (void)write(fd, path.c_str(), path.length() + 1); + IGNORE_RET(write(fd, path.c_str(), path.length() + 1)); close(fd); exit(0); // not reached @@ -293,7 +294,7 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) { // Unblock child process uint8_t data = 1; - (void)write(fds[1], &data, 1); + IGNORE_RET(write(fds[1], &data, 1)); // Child process should have exited with a zero status. int ret; diff --git a/src/client/mac/tests/minidump_generator_test.cc b/src/client/mac/tests/minidump_generator_test.cc index d40c7d98..b1fa5d02 100644 --- a/src/client/mac/tests/minidump_generator_test.cc +++ b/src/client/mac/tests/minidump_generator_test.cc @@ -42,6 +42,7 @@ #include "breakpad_googletest_includes.h" #include "client/mac/handler/minidump_generator.h" #include "client/mac/tests/spawn_child_process.h" +#include "common/linux/ignore_ret.h" #include "common/mac/MachIPC.h" #include "common/tests/auto_tempdir.h" #include "google_breakpad/processor/minidump.h" @@ -190,7 +191,7 @@ TEST_F(MinidumpGeneratorTest, OutOfProcess) { // Unblock child process uint8_t data = 1; - (void)write(fds[1], &data, 1); + IGNORE_RET(write(fds[1], &data, 1)); // Child process should have exited with a zero status. int ret; |