summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 06:32:02 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 06:32:02 +0000
commitae3af08c94d2d7a8fcc4b69a68632a52173f9d51 (patch)
tree3f57b73ab543a2671c8d8b5bf7aa8c873643529f
parent2694360972967479c10a345f16f716ac850f78b3 (diff)
downloadchromium_src-ae3af08c94d2d7a8fcc4b69a68632a52173f9d51.zip
chromium_src-ae3af08c94d2d7a8fcc4b69a68632a52173f9d51.tar.gz
chromium_src-ae3af08c94d2d7a8fcc4b69a68632a52173f9d51.tar.bz2
Fix build errors that occur on Ubuntu 9.10
With g++ 4.4.1, ignoring return values from write() results in compilation errors: error: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result BUG=none TEST=built and ran the tests out/Release/unit_tests --gtest_filter='PipeReaderTest*' out/Release/unit_tests --gtest_filter='ExternalMetricsTest*' Review URL: http://codereview.chromium.org/1564005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43320 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/external_metrics_unittest.cc7
-rw-r--r--chrome/browser/chromeos/pipe_reader_unittest.cc9
2 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/chromeos/external_metrics_unittest.cc b/chrome/browser/chromeos/external_metrics_unittest.cc
index f32ed6b..deaa2b7 100644
--- a/chrome/browser/chromeos/external_metrics_unittest.cc
+++ b/chrome/browser/chromeos/external_metrics_unittest.cc
@@ -23,9 +23,10 @@ class ExternalMetricsTest : public testing::Test {
static void SendMessage(const char* path, const char* name, const char* value) {
int fd = open(path, O_CREAT | O_APPEND | O_WRONLY, 0666);
int32 l = strlen(name) + strlen(value) + 2 + sizeof(l);
- write(fd, &l, sizeof(l));
- write(fd, name, strlen(name) + 1);
- write(fd, value, strlen(value) + 1);
+ int num_bytes;
+ num_bytes = write(fd, &l, sizeof(l));
+ num_bytes = write(fd, name, strlen(name) + 1);
+ num_bytes = write(fd, value, strlen(value) + 1);
close(fd);
}
diff --git a/chrome/browser/chromeos/pipe_reader_unittest.cc b/chrome/browser/chromeos/pipe_reader_unittest.cc
index 3b21798..e745655 100644
--- a/chrome/browser/chromeos/pipe_reader_unittest.cc
+++ b/chrome/browser/chromeos/pipe_reader_unittest.cc
@@ -25,7 +25,8 @@ TEST_F(PipeReaderTest, SuccessfulReadTest) {
if (pID == 0) {
int pipe = open(pipe_name.value().c_str(), O_WRONLY);
EXPECT_NE(pipe, -1) << safe_strerror(errno);
- write(pipe, line, strlen(line));
+ int num_bytes = write(pipe, line, strlen(line));
+ EXPECT_NE(num_bytes, -1) << safe_strerror(errno);
close(pipe);
exit(1);
} else {
@@ -51,7 +52,8 @@ TEST_F(PipeReaderTest, SuccessfulMultiLineReadTest) {
if (pID == 0) {
int pipe = open(pipe_name.value().c_str(), O_WRONLY);
EXPECT_NE(pipe, -1) << safe_strerror(errno);
- write(pipe, line.c_str(), line.length());
+ int num_bytes = write(pipe, line.c_str(), line.length());
+ EXPECT_NE(num_bytes, -1) << safe_strerror(errno);
close(pipe);
exit(1);
} else {
@@ -84,7 +86,8 @@ TEST_F(PipeReaderTest, SuccessfulMultiLineReadNoEndingNewlineTest) {
if (pID == 0) {
int pipe = open(pipe_name.value().c_str(), O_WRONLY);
EXPECT_NE(pipe, -1) << safe_strerror(errno);
- write(pipe, line.c_str(), line.length());
+ int num_bytes = write(pipe, line.c_str(), line.length());
+ EXPECT_NE(num_bytes, -1) << safe_strerror(errno);
close(pipe);
exit(1);
} else {