fix!: open command doesn't work under empty directories (#3226)

This commit is contained in:
三咲雅 misaki masa 2025-10-03 17:45:35 +08:00 committed by sxyazi
parent d8b0425a10
commit 149a5feffb
No known key found for this signature in database
45 changed files with 277 additions and 280 deletions

View file

@ -33,7 +33,7 @@ impl From<Error> for std::io::Error {
Error::IO(e) => e,
Error::Serde(e) => Self::new(std::io::ErrorKind::InvalidData, e),
Error::Status(status) => match status.code {
responses::StatusCode::Ok => Self::new(std::io::ErrorKind::Other, "unexpected OK"),
responses::StatusCode::Ok => Self::other("unexpected OK"),
responses::StatusCode::Eof => Self::from(std::io::ErrorKind::UnexpectedEof),
responses::StatusCode::NoSuchFile => Self::from(std::io::ErrorKind::NotFound),
responses::StatusCode::PermissionDenied => Self::from(std::io::ErrorKind::PermissionDenied),

View file

@ -78,7 +78,7 @@ impl Operator {
status.into()
}
pub async fn fsetstat<'a>(&self, handle: &str, attrs: &'a Attrs) -> Result<(), Error> {
pub async fn fsetstat(&self, handle: &str, attrs: &Attrs) -> Result<(), Error> {
let status: responses::Status = self.send(requests::FSetStat::new(handle, attrs)).await?;
status.into()
}