summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
blob: 8e2a8a90432874362a9e9e3be1c0bf989fb126c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 911f6ea9be0c334885aeff66853b111cbd4066df Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Wed, 10 Feb 2016 17:28:05 +0200
Subject: [PATCH] mdadm-fix-ptest-build-errors

builds fail with ptest enabled:

| restripe.c: In function 'test_stripes':
| restripe.c:845:4: error: ignoring return value of 'read', declared with
| attribute warn_unused_result [-Werror=unused-result]
|     read(source[i], stripes[i], chunk_size);
|     ^
| cc1: all warnings being treated as errors
| Makefile:214: recipe for target 'test_stripe' failed

Upstream-Status: Pending

Signed-off-by: Maxin B. John <maxin.john@intel.com>

---
 restripe.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/restripe.c b/restripe.c
index 31b07e8..592ba5d 100644
--- a/restripe.c
+++ b/restripe.c
@@ -864,10 +864,14 @@ int test_stripes(int *source, unsigned long long *offsets,
 
 	while (length > 0) {
 		int disk;
+        ssize_t ret;
 
 		for (i = 0 ; i < raid_disks ; i++) {
 			lseek64(source[i], offsets[i]+start, 0);
-			read(source[i], stripes[i], chunk_size);
+			ret = read(source[i], stripes[i], chunk_size);
+            if (ret == -1) {
+			  printf("Read Failed\n");
+            }
 		}
 		for (i = 0 ; i < data_disks ; i++) {
 			int disk = geo_map(i, start/chunk_size, raid_disks,