aboutsummaryrefslogtreecommitdiff
path: root/core/net/dns.odin
diff options
context:
space:
mode:
authorColin Davidson <colrdavidson@gmail.com>2023-03-01 08:27:07 -0800
committerColin Davidson <colrdavidson@gmail.com>2023-03-01 08:27:07 -0800
commit2ca30e3acd413bdcc9dbe055b2b70084f08a4ba7 (patch)
treedc51e7ca1832fbba1fa7695da8f74ac13e9a1f7a /core/net/dns.odin
parentcaf9716bf143e24f594e081b7e8ec19a3319dee7 (diff)
more test cleanup
Diffstat (limited to 'core/net/dns.odin')
-rw-r--r--core/net/dns.odin11
1 files changed, 1 insertions, 10 deletions
diff --git a/core/net/dns.odin b/core/net/dns.odin
index 26f6fbb4d..087d2e146 100644
--- a/core/net/dns.odin
+++ b/core/net/dns.odin
@@ -25,20 +25,11 @@ import "core:os"
Default configuration for DNS resolution.
*/
when ODIN_OS == .Windows {
- getenv :: proc(key: string) -> (val: string) {
- return os.get_env(key)
- }
-
DEFAULT_DNS_CONFIGURATION :: DNS_Configuration{
resolv_conf = "",
hosts_file = "%WINDIR%\\system32\\drivers\\etc\\hosts",
}
} else when ODIN_OS == .Linux || ODIN_OS == .Darwin || ODIN_OS == .OpenBSD {
- getenv :: proc(key: string) -> (val: string) {
- val, _ = os.getenv(key)
- return
- }
-
DEFAULT_DNS_CONFIGURATION :: DNS_Configuration{
resolv_conf = "/etc/resolv.conf",
hosts_file = "/etc/hosts",
@@ -81,7 +72,7 @@ replace_environment_path :: proc(path: string, allocator := context.allocator) -
assert(right > 0 && right <= len(path)) // should be covered by there being two %
env_key := path[left: right]
- env_val := getenv(env_key)
+ env_val := os.get_env(env_key)
defer delete(env_val)
res, _ = strings.replace(path, path[left - 1: right + 1], env_val, 1)