libgo: Solaris compatibility patches.

From Rainer Orth.

From-SVN: r182296
This commit is contained in:
Ian Lance Taylor 2011-12-13 19:18:34 +00:00
parent 7b1c3dd9e6
commit 9dadf3bf5e
2 changed files with 4 additions and 3 deletions

View File

@ -85,7 +85,8 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
timeout = &tv
}
var n, e int
var n int
var e error
var tmpReadFds, tmpWriteFds syscall.FdSet
for {
// Temporary syscall.FdSet's into which the values are copied
@ -101,7 +102,7 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
break
}
}
if e != 0 {
if e != nil {
return -1, 0, os.NewSyscallError("select", e)
}
if n == 0 {

View File

@ -10,7 +10,7 @@ import "syscall"
func Hostname() (name string, err error) {
var u syscall.Utsname
if errno := syscall.Uname(&u); errno != 0 {
if errno := syscall.Uname(&u); errno != nil {
return "", NewSyscallError("uname", errno)
}
b := make([]byte, len(u.Nodename))