1
0
mirror of https://github.com/danog/file.git synced 2024-11-29 20:09:10 +01:00

Always provide priorities to eio functions

This commit is contained in:
Aaron Piotrowski 2016-08-24 00:07:22 -05:00
parent 7e54aa20ea
commit 226e196f29
2 changed files with 9 additions and 9 deletions

View File

@ -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);
}
}

View File

@ -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: