From 226e196f29cdd11a569e2a27070ae4aae628e613 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Wed, 24 Aug 2016 00:07:22 -0500 Subject: [PATCH] Always provide priorities to eio functions --- lib/EioDriver.php | 6 +++--- lib/EioHandle.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/EioDriver.php b/lib/EioDriver.php index 5138417..a7d3217 100644 --- a/lib/EioDriver.php +++ b/lib/EioDriver.php @@ -74,7 +74,7 @@ class EioDriver implements Driver { ($this->incrementor)(1); $deferred = new Deferred; $openArr = [$mode, $path, $deferred]; - \eio_open($path, $flags, $chmod, $priority = null, [$this, "onOpenHandle"], $openArr); + \eio_open($path, $flags, $chmod, \EIO_PRI_DEFAULT, [$this, "onOpenHandle"], $openArr); return $deferred->getAwaitable(); } @@ -88,10 +88,10 @@ class EioDriver implements Driver { )); } elseif ($mode[0] === "a") { \array_unshift($openArr, $result); - \eio_ftruncate($result, $offset = 0, $priority = null, [$this, "onOpenFtruncate"], $openArr); + \eio_ftruncate($result, $offset = 0, \EIO_PRI_DEFAULT, [$this, "onOpenFtruncate"], $openArr); } else { \array_unshift($openArr, $result); - \eio_fstat($result, $priority = null, [$this, "onOpenFstat"], $openArr); + \eio_fstat($result, \EIO_PRI_DEFAULT, [$this, "onOpenFstat"], $openArr); } } diff --git a/lib/EioHandle.php b/lib/EioHandle.php index 0526080..d267093 100644 --- a/lib/EioHandle.php +++ b/lib/EioHandle.php @@ -44,7 +44,7 @@ class EioHandle implements Handle { } else { \call_user_func($this->incrementor, 1); $this->isActive = true; - \eio_read($this->fh, $op->readLen, $op->position, $priority = null, [$this, "onRead"], $op); + \eio_read($this->fh, $op->readLen, $op->position, \EIO_PRI_DEFAULT, [$this, "onRead"], $op); } return $deferred->getAwaitable(); @@ -57,12 +57,12 @@ class EioHandle implements Handle { case self::OP_READ: ($this->incrementor)(1); $this->isActive = true; - \eio_read($this->fh, $op->readLen, $op->position, $priority = null, [$this, "onRead"], $op); + \eio_read($this->fh, $op->readLen, $op->position, \EIO_PRI_DEFAULT, [$this, "onRead"], $op); break; case self::OP_WRITE: ($this->incrementor)(1); $this->isActive = true; - \eio_write($this->fh, $op->writeData, \strlen($op->writeData), $op->position, $priority = null, [$this, "onWrite"], $op); + \eio_write($this->fh, $op->writeData, \strlen($op->writeData), $op->position, \EIO_PRI_DEFAULT, [$this, "onWrite"], $op); break; } } @@ -99,7 +99,7 @@ class EioHandle implements Handle { } else { \call_user_func($this->incrementor, 1); $this->isActive = true; - \eio_write($this->fh, $data, strlen($data), $op->position, $priority = null, [$this, "onWrite"], $op); + \eio_write($this->fh, $data, strlen($data), $op->position, \EIO_PRI_DEFAULT, [$this, "onWrite"], $op); } return $deferred->getAwaitable(); @@ -133,7 +133,7 @@ class EioHandle implements Handle { public function close(): Awaitable { ($this->incrementor)(1); $deferred = new Deferred; - \eio_close($this->fh, $priority = null, [$this, "onClose"], $deferred); + \eio_close($this->fh, \EIO_PRI_DEFAULT, [$this, "onClose"], $deferred); return $deferred->getAwaitable(); } @@ -152,7 +152,7 @@ class EioHandle implements Handle { /** * {@inheritdoc} */ - public function seek(int $offset, int $whence = \SEEK_SET): Awaitable { + public function seek(int $offset, int $whence = \SEEK_SET) { $offset = (int) $offset; switch ($whence) { case \SEEK_SET: