From fcf5762500297536d3c3376945684c4f654ffe44 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 3 Mar 2010 10:54:17 +1100 Subject: 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 Signed-off-by: NeilBrown --- restripe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'restripe.c') diff --git a/restripe.c b/restripe.c index f6732061..0f226e37 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) -- cgit v1.2.3