diff --git a/include/resolv.h b/include/resolv.h index 8b23ad66..c9b79c97 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -64,7 +64,7 @@ typedef struct __res_state { #define __RES 19960801 #ifndef _PATH_RESCONF -#define _PATH_RESCONF "/etc/resolv.conf" +#define _PATH_RESCONF "/var/config/network/resolv.conf" #endif struct res_sym { diff --git a/src/locale/iconv.c b/src/locale/iconv.c index bb0e47ec..ae49fc4e 100644 --- a/src/locale/iconv.c +++ b/src/locale/iconv.c @@ -69,7 +69,7 @@ #define ICONV_ERR_ILLEGAL_OPCODE -4 #define ICONV_ERR_MEMORY_OVERFLOW -5 -#define ICONV_CHARSET_PATH_PREFIX "/etc/iconv/" +#define ICONV_CHARSET_PATH_PREFIX "/share/iconv/" static const uint8_t vm_binary_magic[4] = { 'S', 'I', 'C', 'V' }; diff --git a/src/network/getnameinfo.c b/src/network/getnameinfo.c index 133c15b3..f4678195 100644 --- a/src/network/getnameinfo.c +++ b/src/network/getnameinfo.c @@ -47,7 +47,7 @@ static void reverse_hosts(char *buf, const unsigned char *a, unsigned scopeid, i char line[512], *p, *z; unsigned char _buf[1032], atmp[16]; struct address iplit; - FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); + FILE _f, *f = __fopen_rb_ca("/var/config/network/hosts", &_f, _buf, sizeof _buf); if (!f) return; if (family == AF_INET) { memcpy(atmp+12, a, 4); @@ -71,7 +71,7 @@ static void reverse_hosts(char *buf, const unsigned char *a, unsigned scopeid, i if (memcmp(a, iplit.addr, 16) || iplit.scopeid != scopeid) continue; - + for (; *p && isspace(*p); p++); for (z=p; *z && !isspace(*z); z++); *z = 0; @@ -116,7 +116,7 @@ static int dns_parse_callback(void *c, int rr, const void *data, int len, const data, c, 256) <= 0) *(char *)c = 0; return 0; - + } int getnameinfo(const struct sockaddr *restrict sa, socklen_t sl, diff --git a/src/network/lookup_name.c b/src/network/lookup_name.c index 35218185..ab15fffe 100644 --- a/src/network/lookup_name.c +++ b/src/network/lookup_name.c @@ -52,7 +52,7 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati size_t l = strlen(name); int cnt = 0, badfam = 0, have_canon = 0; unsigned char _buf[1032]; - FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); + FILE _f, *f = __fopen_rb_ca("/var/config/network/hosts", &_f, _buf, sizeof _buf); if (!f) switch (errno) { case ENOENT: case ENOTDIR: diff --git a/src/network/resolvconf.c b/src/network/resolvconf.c index ceabf080..78dc4713 100644 --- a/src/network/resolvconf.c +++ b/src/network/resolvconf.c @@ -18,7 +18,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz) conf->attempts = 2; if (search) *search = 0; - f = __fopen_rb_ca("/etc/resolv.conf", &_f, _buf, sizeof _buf); + f = __fopen_rb_ca("/var/config/network/resolv.conf", &_f, _buf, sizeof _buf); if (!f) switch (errno) { case ENOENT: case ENOTDIR: diff --git a/src/time/__tz.c b/src/time/__tz.c index 54ed4cf6..abf7a223 100644 --- a/src/time/__tz.c +++ b/src/time/__tz.c @@ -132,7 +132,7 @@ static void do_tzset() "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; s = getenv("TZ"); - if (!s) s = "/etc/localtime"; + if (!s) s = "/var/config/localtime"; if (!*s) s = __utc; if (old_tz && !strcmp(s, old_tz)) return; @@ -163,7 +163,7 @@ static void do_tzset() || !strcmp(dummy_name, "UTC") || !strcmp(dummy_name, "GMT"))) posix_form = 1; - } + } /* Non-suid can use an absolute tzfile pathname or a relative * pathame beginning with "."; in secure mode, only the @@ -171,7 +171,7 @@ static void do_tzset() if (!posix_form) { if (*s == ':') s++; if (*s == '/' || *s == '.') { - if (!libc.secure || !strcmp(s, "/etc/localtime")) + if (!libc.secure || !strcmp(s, "/var/config/localtime")) map = __map_file(s, &map_size); } else { size_t l = strlen(s); diff --git a/tools/compile-iconv.rs b/tools/compile-iconv.rs index da6a52a9..210b2e6f 100644 --- a/tools/compile-iconv.rs +++ b/tools/compile-iconv.rs @@ -11,8 +11,7 @@ fn main() { let dst = args.next().expect("please specify output file"); let mut octos = Vec::new(); - let src_content = std::fs::read_to_string(&src) - .expect("cannot read source file"); + let src_content = std::fs::read_to_string(&src).expect("cannot read source file"); let mut current_tag = None; for (nline, line) in src_content.lines().enumerate() { let line = line.trim(); @@ -129,7 +128,9 @@ fn do_arg(s: &str, content: &mut [u8; 8], cursor: &mut usize) -> Option<(usize, _ => panic!("unknown radix"), }; *cursor = 8; - *content = u64::from_str_radix(&digit[1..], radix).unwrap().to_be_bytes(); + *content = u64::from_str_radix(&digit[1..], radix) + .unwrap() + .to_be_bytes(); None } else if let Some(reg_id) = s.strip_prefix("&r") { content[*cursor] = reg_id.parse::().unwrap();