From 48473537bf4fc6358394f37aeb7371bd201c0ec1 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 26 Apr 2011 18:52:27 +0200 Subject: [PATCH] Supports dry without a parity file. --- dry.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dry.c b/dry.c index e507eda6..59f1fb74 100644 --- a/dry.c +++ b/dry.c @@ -92,10 +92,12 @@ static int state_dry_process(struct snapraid_state* state, int parity_f, int qar } /* read the parity */ - ret = parity_read(state->parity, parity_f, i, buffer, state->block_size); - if (ret == -1) { - fprintf(stderr, "%u: Parity read error\n", i); - ++error; + if (parity_f != -1) { + ret = parity_read(state->parity, parity_f, i, buffer, state->block_size); + if (ret == -1) { + fprintf(stderr, "%u: Parity read error\n", i); + ++error; + } } /* read the qarity */