mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-01-03 16:35:45 +00:00
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>
This commit is contained in:
parent
64c2eda38a
commit
8b0a1053e2
|
@ -95,7 +95,7 @@ void CrashAndGetMicrodump(const MappingList& mappings,
|
||||||
// has been sanitized.
|
// has been sanitized.
|
||||||
strcpy(identifiable_string, kIdentifiableString);
|
strcpy(identifiable_string, kIdentifiableString);
|
||||||
// Force the strcpy to not be optimized away.
|
// 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();
|
const pid_t child = fork();
|
||||||
if (child == 0) {
|
if (child == 0) {
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "breakpad_googletest_includes.h"
|
#include "breakpad_googletest_includes.h"
|
||||||
#include "client/mac/handler/exception_handler.h"
|
#include "client/mac/handler/exception_handler.h"
|
||||||
|
#include "common/linux/ignore_ret.h"
|
||||||
#include "common/mac/MachIPC.h"
|
#include "common/mac/MachIPC.h"
|
||||||
#include "common/tests/auto_tempdir.h"
|
#include "common/tests/auto_tempdir.h"
|
||||||
#include "google_breakpad/processor/minidump.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");
|
path.append(".dmp");
|
||||||
|
|
||||||
int fd = *reinterpret_cast<int*>(context);
|
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);
|
close(fd);
|
||||||
exit(0);
|
exit(0);
|
||||||
// not reached
|
// not reached
|
||||||
|
@ -293,7 +294,7 @@ TEST_F(ExceptionHandlerTest, DumpChildProcess) {
|
||||||
|
|
||||||
// Unblock child process
|
// Unblock child process
|
||||||
uint8_t data = 1;
|
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.
|
// Child process should have exited with a zero status.
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "breakpad_googletest_includes.h"
|
#include "breakpad_googletest_includes.h"
|
||||||
#include "client/mac/handler/minidump_generator.h"
|
#include "client/mac/handler/minidump_generator.h"
|
||||||
#include "client/mac/tests/spawn_child_process.h"
|
#include "client/mac/tests/spawn_child_process.h"
|
||||||
|
#include "common/linux/ignore_ret.h"
|
||||||
#include "common/mac/MachIPC.h"
|
#include "common/mac/MachIPC.h"
|
||||||
#include "common/tests/auto_tempdir.h"
|
#include "common/tests/auto_tempdir.h"
|
||||||
#include "google_breakpad/processor/minidump.h"
|
#include "google_breakpad/processor/minidump.h"
|
||||||
|
@ -190,7 +191,7 @@ TEST_F(MinidumpGeneratorTest, OutOfProcess) {
|
||||||
|
|
||||||
// Unblock child process
|
// Unblock child process
|
||||||
uint8_t data = 1;
|
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.
|
// Child process should have exited with a zero status.
|
||||||
int ret;
|
int ret;
|
||||||
|
|
Loading…
Reference in a new issue