mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05:00
Adds pid file support.
This commit is contained in:
parent
875081f530
commit
bc2a837953
8 changed files with 149 additions and 14 deletions
7
state.c
7
state.c
|
|
@ -45,6 +45,7 @@ void state_init(struct snapraid_state* state)
|
|||
state->qarity_device = 0;
|
||||
state->pool[0] = 0;
|
||||
state->pool_device = 0;
|
||||
state->pidfile[0] = 0;
|
||||
state->level = 1; /* default is the lowest protection */
|
||||
|
||||
tommy_list_init(&state->disklist);
|
||||
|
|
@ -462,6 +463,12 @@ void state_config(struct snapraid_state* state, const char* path, const char* co
|
|||
content = content_alloc(buffer, st.st_dev);
|
||||
|
||||
tommy_list_insert_tail(&state->contentlist, &content->node, content);
|
||||
|
||||
/* if not set pid file, set it as the first content file */
|
||||
if (!state->pidfile[0]) {
|
||||
pathcpy(state->pidfile, sizeof(state->pidfile), buffer);
|
||||
pathcat(state->pidfile, sizeof(state->pidfile), ".pid");
|
||||
}
|
||||
} else if (strcmp(tag, "disk") == 0) {
|
||||
char dir[PATH_MAX];
|
||||
char device[PATH_MAX];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue