mirror of
https://github.com/danog/file.git
synced 2024-11-26 11:54:54 +01:00
Ignore errors when closing
This commit is contained in:
parent
2ce32d57ff
commit
ad309f0cd2
@ -201,18 +201,9 @@ class EioHandle implements Handle {
|
||||
return $deferred->promise();
|
||||
}
|
||||
|
||||
private function onClose($deferred, $result, $req) {
|
||||
if ($result === -1) {
|
||||
$error = \eio_get_last_error($req);
|
||||
if ($error === "Bad file descriptor") {
|
||||
// Handle is already closed, ignore
|
||||
private function onClose(Deferred $deferred, $result, $req) {
|
||||
// Ignore errors when closing file, as the handle will become invalid anyway.
|
||||
$deferred->resolve();
|
||||
} else {
|
||||
$deferred->fail(new StreamException("Closing the file failed: " . $error));
|
||||
}
|
||||
} else {
|
||||
$deferred->resolve();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -247,7 +247,7 @@ class UvHandle implements Handle {
|
||||
$this->poll->listen($this->closing = $deferred->promise());
|
||||
|
||||
\uv_fs_close($this->loop, $this->fh, function ($fh) use ($deferred) {
|
||||
// FIXME: Check for errors
|
||||
// Ignore errors when closing file, as the handle will become invalid anyway.
|
||||
$deferred->resolve();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user