1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-25 11:57:42 +02:00
ttrss/vendor/thecodingmachine/safe/generated/inotify.php
Andrew Dolgov 3fd7856543 * switch to composer for qrcode and otp dependencies
* move most OTP-related stuff into userhelper
* remove old phpqrcode and otphp libraries
2021-02-26 19:16:17 +03:00

45 lines
955 B
PHP

<?php
namespace Safe;
use Safe\Exceptions\InotifyException;
/**
* Initialize an inotify instance for use with
* inotify_add_watch
*
* @return resource A stream resource.
* @throws InotifyException
*
*/
function inotify_init()
{
error_clear_last();
$result = \inotify_init();
if ($result === false) {
throw InotifyException::createFromPhpError();
}
return $result;
}
/**
* inotify_rm_watch removes the watch
* watch_descriptor from the inotify instance
* inotify_instance.
*
* @param resource $inotify_instance Resource returned by
* inotify_init
* @param int $watch_descriptor Watch to remove from the instance
* @throws InotifyException
*
*/
function inotify_rm_watch($inotify_instance, int $watch_descriptor): void
{
error_clear_last();
$result = \inotify_rm_watch($inotify_instance, $watch_descriptor);
if ($result === false) {
throw InotifyException::createFromPhpError();
}
}