Commit 68cab0c2 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Cleanup of ToStatus().

parent 21a255f0
...@@ -32,7 +32,9 @@ func (code Status) Ok() bool { ...@@ -32,7 +32,9 @@ func (code Status) Ok() bool {
// Convert error back to Errno based errors. // Convert error back to Errno based errors.
func ToStatus(err error) Status { func ToStatus(err error) Status {
if err != nil { if err == nil {
return OK
}
switch t := err.(type) { switch t := err.(type) {
case syscall.Errno: case syscall.Errno:
return Status(t) return Status(t)
...@@ -42,12 +44,9 @@ func ToStatus(err error) Status { ...@@ -42,12 +44,9 @@ func ToStatus(err error) Status {
return ToStatus(t.Err) return ToStatus(t.Err)
case *os.LinkError: case *os.LinkError:
return ToStatus(t.Err) return ToStatus(t.Err)
default: }
log.Println("can't convert error type:", err) log.Println("can't convert error type:", err)
return ENOSYS return ENOSYS
}
}
return OK
} }
func splitDuration(dt time.Duration, secs *uint64, nsecs *uint32) { func splitDuration(dt time.Duration, secs *uint64, nsecs *uint32) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment