mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Fixes the device detection of the pool dir.
We should not remove the file name, because it's already the directory.
This commit is contained in:
parent
a8c87614f1
commit
dffb1c655f
1 changed files with 2 additions and 10 deletions
12
state.c
12
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue