diff --git a/lib/EioHandle.php b/lib/EioHandle.php index e0bb233..994ca12 100644 --- a/lib/EioHandle.php +++ b/lib/EioHandle.php @@ -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 - $deferred->resolve(); - } else { - $deferred->fail(new StreamException("Closing the file failed: " . $error)); - } - } else { - $deferred->resolve(); - } + private function onClose(Deferred $deferred, $result, $req) { + // Ignore errors when closing file, as the handle will become invalid anyway. + $deferred->resolve(); } /** diff --git a/lib/UvHandle.php b/lib/UvHandle.php index 14bae6c..202c223 100644 --- a/lib/UvHandle.php +++ b/lib/UvHandle.php @@ -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(); });