Bloody lazy Crapple

No mknodat. Sigh.
This commit is contained in:
Kovid Goyal
2026-04-24 14:22:41 +05:30
parent 2c37fb4845
commit ca7388c145
3 changed files with 43 additions and 6 deletions

View File

@@ -347,12 +347,7 @@ func ConvertFileModeToUnix(goMode os.FileMode) uint32 {
func MknodAt(parent *os.File, name string, mode os.FileMode, dev int) (err error) {
unix_mode := ConvertFileModeToUnix(mode)
for {
if err = unix.Mknodat(int(parent.Fd()), name, unix_mode, dev); err != unix.EINTR {
break
}
}
if err != nil {
if err = mknodAt(parent, name, unix_mode, dev); err != nil {
err = &os.PathError{Op: "mknodat", Path: filepath.Join(parent.Name(), name), Err: err}
}
return