mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Minor refactor, rgen only needed here
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
ecb5949679
commit
d70e2f1ed0
1 file changed
+6
-7
+6
-7
@@ -232,19 +232,18 @@ int cond_set_path(const char *path, enum cond_state next)
|
|||||||
unsigned int rgen;
|
unsigned int rgen;
|
||||||
|
|
||||||
dbg("%s <= %d", path, next);
|
dbg("%s <= %d", path, next);
|
||||||
|
|
||||||
rgen = cond_get_gen(_PATH_RECONF);
|
|
||||||
if (!rgen) {
|
|
||||||
errx(1, "Unable to read configuration generation (%s)", path);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
prev = cond_get_path(path);
|
prev = cond_get_path(path);
|
||||||
|
|
||||||
switch (next) {
|
switch (next) {
|
||||||
case COND_ON:
|
case COND_ON:
|
||||||
if (cond_checkpath(path))
|
if (cond_checkpath(path))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
rgen = cond_get_gen(_PATH_RECONF);
|
||||||
|
if (!rgen) {
|
||||||
|
errx(1, "Unable to read configuration generation (%s)", path);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
cond_set_gen(path, rgen);
|
cond_set_gen(path, rgen);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user