os/errno:fix os.Errno 's nil pointer derefer in linux

This commit is contained in:
luoliwoshang
2024-10-12 11:58:53 +08:00
parent 9ea88fe247
commit e9177c8932
10 changed files with 54 additions and 22 deletions

View File

@@ -183,7 +183,7 @@ func Getwd() (dir string, err error) {
if wd != nil {
return c.GoString(wd), nil
}
return "", syscall.Errno(os.Errno)
return "", syscall.Errno(os.Errno())
}
// TODO(xsw):

View File

@@ -33,7 +33,7 @@ func (f *File) write(b []byte) (int, error) {
if ret >= 0 {
return int(ret), nil
}
return 0, syscall.Errno(os.Errno)
return 0, syscall.Errno(os.Errno())
}
/* TODO(xsw):
@@ -56,7 +56,7 @@ func (f *File) read(b []byte) (int, error) {
if ret == 0 {
return 0, io.EOF
}
return 0, syscall.Errno(os.Errno)
return 0, syscall.Errno(os.Errno())
}
/* TODO(xsw):