From dffb1c655f9ac0b984b11846c1c62eac03d60ed2 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 10 Mar 2013 09:46:20 +0100 Subject: [PATCH] Fixes the device detection of the pool dir. We should not remove the file name, because it's already the directory. --- state.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/state.c b/state.c index 60bcf9e0..5ef7f928 100644 --- a/state.c +++ b/state.c @@ -371,8 +371,6 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* we have two level of parity */ state->level = 2; } else if (strcmp(tag, "pool") == 0) { - char device[PATH_MAX]; - char* slash; struct stat st; if (*state->pool) { @@ -394,14 +392,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co pathimport(state->pool, sizeof(state->pool), buffer); /* get the device of the directory containing the pool tree */ - pathimport(device, sizeof(device), buffer); - slash = strrchr(device, '/'); - if (slash) - *slash = 0; - else - pathcpy(device, sizeof(device), "."); - if (stat(device, &st) != 0) { - fprintf(stderr, "Error accessing 'pool' dir '%s' specification in '%s' at line %u\n", device, path, line); + if (stat(buffer, &st) != 0) { + fprintf(stderr, "Error accessing 'pool' dir '%s' specification in '%s' at line %u\n", buffer, path, line); exit(EXIT_FAILURE); }