mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
check correct errno in _readlink
This commit is contained in:
@@ -666,9 +666,9 @@ _readlink :: proc(path: string) -> (string, Errno) {
|
|||||||
buf := make([]byte, bufsz)
|
buf := make([]byte, bufsz)
|
||||||
for {
|
for {
|
||||||
rc := _unix_readlink(path_cstr, &(buf[0]), bufsz)
|
rc := _unix_readlink(path_cstr, &(buf[0]), bufsz)
|
||||||
if rc == -1 {
|
if rc < 0 {
|
||||||
delete(buf)
|
delete(buf)
|
||||||
return "", Errno(get_last_error())
|
return "", _get_errno(rc)
|
||||||
} else if rc == int(bufsz) {
|
} else if rc == int(bufsz) {
|
||||||
// NOTE(laleksic, 2021-01-21): Any cleaner way to resize the slice?
|
// NOTE(laleksic, 2021-01-21): Any cleaner way to resize the slice?
|
||||||
bufsz *= 2
|
bufsz *= 2
|
||||||
|
|||||||
Reference in New Issue
Block a user