aboutsummaryrefslogtreecommitdiff
path: root/networking/ifupdown.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-19 21:49:30 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-19 21:49:30 +0000
commit2a86a61c270a7d64bcc18a81b0d9004699b1be0f (patch)
tree6c97c107c7eaae830141f6feb9de8fccfa938ef1 /networking/ifupdown.c
parent2414a96faae906da8519229f12bebe5fe00078e7 (diff)
downloadbusybox-2a86a61c270a7d64bcc18a81b0d9004699b1be0f.tar.gz
ifup/ifdown: make location of ifstate configurable
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r--networking/ifupdown.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index e9f0a646c..5aa3fa5f1 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -10,7 +10,9 @@
* Changes to upstream version
* Remove checks for kernel version, assume kernel version 2.2.0 or better.
* Lines in the interfaces file cannot wrap.
- * To adhere to the FHS, the default state file is /var/run/ifstate.
+ * To adhere to the FHS, the default state file is /var/run/ifstate
+ * (defined via CONFIG_IFUPDOWN_IFSTATE_PATH) and can be overridden by build
+ * configuration.
*
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
@@ -1105,7 +1107,7 @@ static llist_t *find_iface_state(llist_t *state_list, const char *iface)
static llist_t *read_iface_state(void)
{
llist_t *state_list = NULL;
- FILE *state_fp = fopen("/var/run/ifstate", "r");
+ FILE *state_fp = fopen(CONFIG_IFUPDOWN_IFSTATE_PATH, "r");
if (state_fp) {
char *start, *end_ptr;
@@ -1275,7 +1277,7 @@ int ifupdown_main(int argc, char **argv)
}
/* Actually write the new state */
- state_fp = xfopen("/var/run/ifstate", "w");
+ state_fp = xfopen(CONFIG_IFUPDOWN_IFSTATE_PATH, "w");
state = state_list;
while (state) {
if (state->data) {