erigon-pulse/ethdb/mdbx/error_unix.go

22 lines
353 B
Go
Raw Normal View History

2020-10-28 03:18:10 +00:00
// +build !windows
package mdbx
/*
#include "mdbxgo.h"
*/
import "C"
import (
"syscall"
)
func operrno(op string, ret C.int) error {
if ret == C.MDBX_SUCCESS || ret == C.MDBX_RESULT_TRUE {
return nil
}
if minErrno <= ret && ret <= maxErrno {
return &OpError{Op: op, Errno: Errno(ret)}
}
return &OpError{Op: op, Errno: syscall.Errno(ret)}
}