summaryrefslogtreecommitdiffstats
path: root/restripe.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-03-03 10:54:17 +1100
committerNeilBrown <neilb@suse.de>2010-03-03 10:54:17 +1100
commitfcf5762500297536d3c3376945684c4f654ffe44 (patch)
treedf16a74f63ba3739e467c62e580f6bcc7f019389 /restripe.c
parent53f50353399f71aef4041b42df845803e7388d12 (diff)
downloadmdadm-fcf5762500297536d3c3376945684c4f654ffe44.tar.gz
mdadm-fcf5762500297536d3c3376945684c4f654ffe44.tar.xz
mdadm-fcf5762500297536d3c3376945684c4f654ffe44.zip
Add _FORTIFY_SOURCE to mdadm.O2 build.
When building mdadm.O2, set _FORTIFY_SOURCE to get more warnings, and also build mdmon.O2 to find warnings in that code too. Then fix the warnings. Suggested-by: Luca Berra <bluca@comedia.it> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'restripe.c')
-rw-r--r--restripe.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/restripe.c b/restripe.c
index f673206..0f226e3 100644
--- a/restripe.c
+++ b/restripe.c
@@ -565,7 +565,8 @@ int restore_stripes(int *dest, unsigned long long *offsets,
int data_disks = raid_disks - (level == 0 ? 0 : level <= 5 ? 1 : 2);
- posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size);
+ if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size))
+ stripe_buf = NULL;
if (zero == NULL) {
zero = malloc(chunk_size);
if (zero)