chunked: return PathError for mkdirat

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2024-06-07 11:27:14 +02:00
parent 4955d9b3f1
commit 1512399b81
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772
1 changed files with 2 additions and 2 deletions

View File

@ -417,7 +417,7 @@ func openOrCreateDirUnderRoot(dirfd int, name string, mode os.FileMode) (*os.Fil
baseName := filepath.Base(name)
if err2 := unix.Mkdirat(int(pDir.Fd()), baseName, uint32(mode)); err2 != nil {
return nil, err
return nil, &fs.PathError{Op: "mkdirat", Path: name, Err: err2}
}
fd, err = openFileUnderRootRaw(int(pDir.Fd()), baseName, unix.O_DIRECTORY|unix.O_RDONLY, 0)
@ -456,7 +456,7 @@ func safeMkdir(dirfd int, mode os.FileMode, name string, metadata *fileMetadata,
if err := unix.Mkdirat(parentFd, base, uint32(mode)); err != nil {
if !os.IsExist(err) {
return fmt.Errorf("mkdir %q: %w", name, err)
return &fs.PathError{Op: "mkdirat", Path: name, Err: err}
}
}