This forces all syscall functions, notably filesystem, to return numeric codes as opposed to mapping in two different areas. The result of this change is better consolidation in call sites of `sysfs.FS`, while further refactoring is needed to address consolidation of file errors. Signed-off-by: Adrian Cole <adrian@tetrate.io>
14 lines
236 B
Go
14 lines
236 B
Go
//go:build !windows
|
|
|
|
package platform
|
|
|
|
import "syscall"
|
|
|
|
func Unlink(name string) (errno syscall.Errno) {
|
|
err := syscall.Unlink(name)
|
|
if errno = UnwrapOSError(err); errno == syscall.EPERM {
|
|
errno = syscall.EISDIR
|
|
}
|
|
return errno
|
|
}
|