We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2cd92f commit 3e52a32Copy full SHA for 3e52a32
src/runc/container.rs
@@ -28,10 +28,15 @@ impl CgroupEventNotifier {
28
29
fn populated(&mut self) -> Result<bool> {
30
let file = self.file.get_mut();
31
- file.seek(std::io::SeekFrom::Start(0))
32
- .context("Cannot seek to start")?;
+ let Ok(_) = file.seek(std::io::SeekFrom::Start(0)) else {
+ return Ok(false);
33
+ };
34
for line in BufReader::new(file).lines() {
- let line = line.context("Cannot read line")?;
35
+ let Ok(line) = line else {
36
+ // IO errors on cgroup.events file indicate that the cgroup has been deleted, so
37
+ // it is no longer populated.
38
39
40
if line.starts_with("populated ") {
41
return Ok(line.ends_with('1'));
42
}
0 commit comments