mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 03:16:59 -05:00
Moves the lock file where the first content file resides.
This commit is contained in:
parent
5c27e62cd2
commit
4b93f3e5ab
3 changed files with 14 additions and 6 deletions
12
state.c
12
state.c
|
|
@ -516,12 +516,6 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
|
||||
state->parity_device[l] = st.st_dev;
|
||||
|
||||
/* set lock file if first parity */
|
||||
if (l == 0) {
|
||||
pathcpy(state->lockfile, sizeof(state->lockfile), state->parity_path[l]);
|
||||
pathcat(state->lockfile, sizeof(state->lockfile), ".lock");
|
||||
}
|
||||
|
||||
/* adjust the level */
|
||||
if (state->level < l + 1)
|
||||
state->level = l + 1;
|
||||
|
|
@ -640,6 +634,12 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* set the lock file at the first content file */
|
||||
if (tommy_list_empty(&state->contentlist)) {
|
||||
pathcpy(state->lockfile, sizeof(state->lockfile), buffer);
|
||||
pathcat(state->lockfile, sizeof(state->lockfile), ".lock");
|
||||
}
|
||||
|
||||
content = content_alloc(buffer, st.st_dev);
|
||||
|
||||
tommy_list_insert_tail(&state->contentlist, &content->node, content);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue