mirror of
https://github.com/troglobit/finit.git
synced 2026-11-24 20:21:44 +00:00
conf.c: Clarify comments, also include file paths must now be absolute.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
2c1f3b1f7a
commit
7236e8c6a3
1 file changed
+5
-11
@@ -145,24 +145,19 @@ static void parse_static(char *line)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the directory from which executable scripts and
|
|
||||||
* any finit include files are read, default /etc/finit.d/ */
|
|
||||||
if (MATCH_CMD(line, "runparts ", x)) {
|
if (MATCH_CMD(line, "runparts ", x)) {
|
||||||
if (runparts) free(runparts);
|
if (runparts) free(runparts);
|
||||||
runparts = strdup(strip_line(x));
|
runparts = strdup(strip_line(x));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse any include file, use rcsd if absolute path not given */
|
|
||||||
if (MATCH_CMD(line, "include ", x)) {
|
if (MATCH_CMD(line, "include ", x)) {
|
||||||
char *file = strip_line(x);
|
char *file = strip_line(x);
|
||||||
|
|
||||||
strlcpy(cmd, file, sizeof(cmd));
|
strlcpy(cmd, file, sizeof(cmd));
|
||||||
if (!fexist(cmd)) {
|
if (!fexist(cmd)) {
|
||||||
/* ... try /etc/finit.d/ as prefix */
|
_e("Cannot find include file %s, absolute path required!", x);
|
||||||
snprintf(cmd, sizeof(cmd), "%s/%s", rcsd, file);
|
return;
|
||||||
if (!fexist(cmd))
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_conf(cmd);
|
parse_conf(cmd);
|
||||||
@@ -180,10 +175,9 @@ static void parse_static(char *line)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The desired runlevel to start when leaving
|
/* The desired runlevel to start when leaving bootstrap (S).
|
||||||
* bootstrap (S). Finit supports 1-9, but most
|
* Finit supports 1-9, but most systems only use 1-6, where
|
||||||
* systems only use 1-6, where 6 is reserved for
|
* 6 is reserved for reboot */
|
||||||
* reboot */
|
|
||||||
if (MATCH_CMD(line, "runlevel ", x)) {
|
if (MATCH_CMD(line, "runlevel ", x)) {
|
||||||
char *token = strip_line(x);
|
char *token = strip_line(x);
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user