diff options
author | 2018-10-29 16:56:52 +0800 | |
---|---|---|
committer | 2018-12-26 09:23:24 +0800 | |
commit | 0ca6bd545292b94501b3d89c14be8eba9cf42d22 (patch) | |
tree | 2674096b92d11c147d5e68748c95437a613e67d5 /stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c | |
parent | 6f487b9221e5a0a5dd95d150509684570473ae1d (diff) |
Fix: change the search path
modify the path of lwip configure file
Change-Id: I1346a2e84cc74b3f3a2075b77d25a452bde53642
Signed-off-by: rainbow_0206 <jiangwenjiang@huawei.com>
Diffstat (limited to 'stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c')
-rw-r--r-- | stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c b/stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c index e2334ea..6e10c7a 100644 --- a/stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c +++ b/stacks/lwip_stack/lwip_src/ip_module/configuration_reader.c @@ -361,7 +361,14 @@ get_network_json_data () tmp_config_path = realpath ("./network_data_tonStack.json", NULL); if (!tmp_config_path) { - exit (1); + NSTCP_LOGINF ("Warning! It use the second search path ../configure"); + tmp_config_path = + realpath ("../configure/network_data_tonStack.json", NULL); + } + + if (!tmp_config_path) + { + return 1; } int fp = open (tmp_config_path, O_RDONLY); @@ -454,7 +461,13 @@ get_ip_json_data () tmp_config_path = realpath ("./ip_data.json", NULL); if (!tmp_config_path) { - exit (1); + NSTCP_LOGINF ("Warning! It use the second search path ../configure"); + tmp_config_path = realpath ("../configure/ip_data.json", NULL); + } + + if (!tmp_config_path) + { + return 1; } int fp = open (tmp_config_path, O_RDONLY); |