mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
fix read_all bug in PDDB
This commit is contained in:
parent
4698a98d40
commit
17446588bb
1 changed files with 6 additions and 2 deletions
|
|
@ -113,7 +113,11 @@ impl<'a> Read for PddbKey<'a> {
|
||||||
}
|
}
|
||||||
PddbRetcode::BasisLost => Err(Error::new(ErrorKind::BrokenPipe, "Basis lost")),
|
PddbRetcode::BasisLost => Err(Error::new(ErrorKind::BrokenPipe, "Basis lost")),
|
||||||
PddbRetcode::AccessDenied => Err(Error::new(ErrorKind::PermissionDenied, "Access denied")),
|
PddbRetcode::AccessDenied => Err(Error::new(ErrorKind::PermissionDenied, "Access denied")),
|
||||||
_ => Err(Error::new(ErrorKind::Other, "Unhandled error code in PddbKey Read")),
|
PddbRetcode::UnexpectedEof => Ok(0), // I believe this is the "expected" behavior for reads that want to read beyond the current end of file
|
||||||
|
_ => {
|
||||||
|
log::error!("Unhandled error code: {:?}", pbuf.retcode);
|
||||||
|
Err(Error::new(ErrorKind::Other, "Unhandled error code in PddbKey Read"))
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +162,7 @@ impl<'a> Write for PddbKey<'a> {
|
||||||
}
|
}
|
||||||
PddbRetcode::BasisLost => Err(Error::new(ErrorKind::BrokenPipe, "Basis lost")),
|
PddbRetcode::BasisLost => Err(Error::new(ErrorKind::BrokenPipe, "Basis lost")),
|
||||||
PddbRetcode::AccessDenied => Err(Error::new(ErrorKind::PermissionDenied, "Access denied")),
|
PddbRetcode::AccessDenied => Err(Error::new(ErrorKind::PermissionDenied, "Access denied")),
|
||||||
_ => Err(Error::new(ErrorKind::Other, "Unhandled error code in PddbKey Read")),
|
_ => Err(Error::new(ErrorKind::Other, "Unhandled error code in PddbKey Write")),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue