[Slirp] [Git][slirp/libslirp][master] 2 commits: Haiku: proper path to resolv.conf for DNS server
Samuel Thibault (@sthibaul)
gitlab at gitlab.freedesktop.org
Mon Jul 5 20:31:37 UTC 2021
Samuel Thibault pushed to branch master at slirp / libslirp
Commits:
71088655 by Richard Zak at 2021-07-05T20:31:34+00:00
Haiku: proper path to resolv.conf for DNS server
- - - - -
a88d9ace by Samuel Thibault at 2021-07-05T20:31:34+00:00
Merge branch 'master' into 'master'
Haiku: proper path to resolv.conf for DNS server
See merge request slirp/libslirp!99
- - - - -
1 changed file:
- src/slirp.c
Changes:
=====================================
src/slirp.c
=====================================
@@ -218,6 +218,12 @@ int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id)
#else // !defined(_WIN32) && !defined(__APPLE__)
+#if defined(__HAIKU__)
+#define RESOLV_CONF_PATH "/boot/system/settings/network/resolv.conf"
+#else
+#define RESOLV_CONF_PATH "/etc/resolv.conf"
+#endif
+
static int get_dns_addr_cached(void *pdns_addr, void *cached_addr,
socklen_t addrlen, struct stat *cached_stat,
unsigned *cached_time)
@@ -228,7 +234,7 @@ static int get_dns_addr_cached(void *pdns_addr, void *cached_addr,
return 0;
}
old_stat = *cached_stat;
- if (stat("/etc/resolv.conf", cached_stat) != 0) {
+ if (stat(RESOLV_CONF_PATH, cached_stat) != 0) {
return -1;
}
if (cached_stat->st_dev == old_stat.st_dev &&
@@ -256,7 +262,7 @@ static int get_dns_addr_resolv_conf(int af, void *pdns_addr, void *cached_addr,
unsigned if_index;
assert(sizeof(tmp_addr) >= addrlen);
- f = fopen("/etc/resolv.conf", "r");
+ f = fopen(RESOLV_CONF_PATH, "r");
if (!f)
return -1;
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/cdfbb3c2a46c3277241b3ccf0172be977701fd4a...a88d9ace234a24ce1c17189642ef9104799425e0
--
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/cdfbb3c2a46c3277241b3ccf0172be977701fd4a...a88d9ace234a24ce1c17189642ef9104799425e0
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210705/f2fb800e/attachment-0001.htm>
More information about the Slirp
mailing list