mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
convert all to use sys/linux over sys/unix; new implementations for pipe, process and env
This commit is contained in:
@@ -99,3 +99,19 @@ error_string :: proc(ferr: Error) -> string {
|
||||
|
||||
return "unknown error"
|
||||
}
|
||||
|
||||
print_error :: proc(ferr: Error, msg: string) {
|
||||
TEMP_ALLOCATOR_GUARD()
|
||||
err_str := error_string(ferr)
|
||||
|
||||
// msg + ": " + err_str + '\n'
|
||||
length := len(msg) + 2 + len(err_str) + 1
|
||||
buf := make([]u8, length, temp_allocator())
|
||||
|
||||
copy(buf, msg)
|
||||
buf[len(msg)] = ':'
|
||||
buf[len(msg) + 1] = ' '
|
||||
copy(buf[len(msg) + 2:], err_str)
|
||||
buf[length - 1] = '\n'
|
||||
write(stderr, buf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user