[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1577262865-10253-1-git-send-email-teawater@gmail.com>
Date: Wed, 25 Dec 2019 16:34:25 +0800
From: Hui Zhu <teawater@...il.com>
To: fengguang.wu@...el.com, linux-kernel@...r.kernel.org
Cc: Hui Zhu <teawater@...il.com>, Hui Zhu <teawaterz@...ux.alibaba.com>
Subject: [PATCH for vm-scalability] usemem: Fix the build warning
Got:
gcc -O -c -Wall -g usemem.c -o usemem.o
usemem.c: In function ‘output_statistics’:
usemem.c:638:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(1, buf, len);
This commit fixes this warning.
Signed-off-by: Hui Zhu <teawaterz@...ux.alibaba.com>
---
usemem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usemem.c b/usemem.c
index 85dbdc5..9158304 100644
--- a/usemem.c
+++ b/usemem.c
@@ -635,7 +635,8 @@ static void output_statistics(unsigned long unit_bytes, const char *intro)
"%s%lu bytes / %lu usecs = %lu KB/s\n",
intro, unit_bytes, delta_us, throughput);
fflush(stdout);
- write(1, buf, len);
+ if (write(1, buf, len) != len)
+ printf("Output buf \"%s\" fail\n", buf);
}
static void timing_free(void *ptrs[], unsigned int nptr,
--
2.7.4
Powered by blists - more mailing lists