InterruptFS.ReadFile
parent
aeca4a00d5
commit
0b00132020
|
@ -136,3 +136,22 @@ func (fs *InterruptFS) OpenFile(
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fs *InterruptFS) ReadFile(
|
||||||
|
op *fuseops.ReadFileOp) {
|
||||||
|
var err error
|
||||||
|
defer fuseutil.RespondToOp(op, &err)
|
||||||
|
|
||||||
|
// Wait for cancellation.
|
||||||
|
done := op.Context().Done()
|
||||||
|
if done == nil {
|
||||||
|
panic("Expected non-nil channel.")
|
||||||
|
}
|
||||||
|
|
||||||
|
<-done
|
||||||
|
|
||||||
|
// Return the context's error.
|
||||||
|
err = op.Context().Err()
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue