mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-19 14:11:07 +00:00
Fix more merge conflicts.
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
#+private
|
||||
package net
|
||||
|
||||
import "core:os"
|
||||
import os "core:os/os2"
|
||||
|
||||
load_resolv_conf :: proc(resolv_conf_path: string, allocator := context.allocator) -> (name_servers: []Endpoint, ok: bool) {
|
||||
context.allocator = allocator
|
||||
|
||||
res := os.read_entire_file_from_filename(resolv_conf_path) or_return
|
||||
res, err := os.read_entire_file(resolv_conf_path, allocator)
|
||||
if err != nil { return }
|
||||
defer delete(res)
|
||||
resolv_str := string(res)
|
||||
|
||||
@@ -15,10 +16,9 @@ load_resolv_conf :: proc(resolv_conf_path: string, allocator := context.allocato
|
||||
}
|
||||
|
||||
load_hosts :: proc(hosts_file_path: string, allocator := context.allocator) -> (hosts: []DNS_Host_Entry, ok: bool) {
|
||||
hosts_file, err := os.open(hosts_file_path)
|
||||
handle, err := os.open(hosts_file_path)
|
||||
if err != nil { return }
|
||||
defer os.close(hosts_file)
|
||||
|
||||
return parse_hosts(os.stream_from_handle(hosts_file), allocator)
|
||||
}
|
||||
defer os.close(handle)
|
||||
|
||||
return parse_hosts(os.to_stream(handle), allocator)
|
||||
}
|
||||
@@ -91,7 +91,7 @@ stop_test_callback :: proc "c" (sig: libc.int) {
|
||||
advisory_a := `
|
||||
The test runner's main thread has caught an unrecoverable error (signal `
|
||||
advisory_b := `) and will now forcibly terminate.
|
||||
This is a dire bug and should be reported to the Odin developers.
|
||||
Unless you terminated the tests yourself, this could be a dire bug and should be reported to the Odin developers.
|
||||
`
|
||||
libc.fwrite(raw_data(advisory_a), size_of(byte), len(advisory_a), libc.stderr)
|
||||
libc.fwrite(raw_data(sigstr), size_of(byte), len(sigstr), libc.stderr)
|
||||
|
||||
Reference in New Issue
Block a user