InterruptFS.ReadFile

geesefs-0-30-9
Aaron Jacobs 2015-05-04 21:56:43 +10:00
parent aeca4a00d5
commit 0b00132020
1 changed files with 19 additions and 0 deletions

View File

@ -136,3 +136,22 @@ func (fs *InterruptFS) OpenFile(
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
}