Skip to content

Commit e129fd6

Browse files
committed
rebaseme: swap from EBADF to ENOENT for missing init
Signed-off-by: Geoffrey Goodman <geoff@goodman.dev>
1 parent 5821070 commit e129fd6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/devices/src/virtio/fs/linux/passthrough.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ impl PassthroughFs {
461461
}
462462

463463
fn init_payload(&self) -> io::Result<&[u8]> {
464-
self.cfg.init_payload.ok_or_else(ebadf)
464+
self.cfg
465+
.init_payload
466+
.ok_or_else(|| io::Error::from_raw_os_error(libc::ENOENT))
465467
}
466468

467469
fn open_inode(&self, inode: Inode, mut flags: i32) -> io::Result<File> {

src/devices/src/virtio/fs/macos/passthrough.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,9 @@ impl PassthroughFs {
599599
}
600600

601601
fn init_payload(&self) -> io::Result<&[u8]> {
602-
self.cfg.init_payload.ok_or_else(ebadf)
602+
self.cfg
603+
.init_payload
604+
.ok_or_else(|| linux_error(io::Error::from_raw_os_error(libc::ENOENT)))
603605
}
604606

605607
fn inode_to_handle(&self, inode: Inode, supports_fd: bool) -> io::Result<InodeHandle> {

0 commit comments

Comments
 (0)