summaryrefslogtreecommitdiffstats
path: root/src/libudev/libudev-queue.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-08-24 06:41:22 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-11 05:45:21 +0200
commitd35c0e8d534399faa252a5f44a96c35f887f8bfd (patch)
treecf7b57e809b6cb2abe13199a84e76b36c6d57631 /src/libudev/libudev-queue.c
parentlibudev-queue: use structured initializer (diff)
downloadsystemd-d35c0e8d534399faa252a5f44a96c35f887f8bfd.tar.xz
systemd-d35c0e8d534399faa252a5f44a96c35f887f8bfd.zip
libudev-queue: use assert_return()
Diffstat (limited to '')
-rw-r--r--src/libudev/libudev-queue.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libudev/libudev-queue.c b/src/libudev/libudev-queue.c
index a62ba5ebfe..e7d8ffea4c 100644
--- a/src/libudev/libudev-queue.c
+++ b/src/libudev/libudev-queue.c
@@ -94,12 +94,9 @@ DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(struct udev_queue, udev_queue, udev_queue_f
*
* Returns: the udev library context.
**/
-_public_ struct udev *udev_queue_get_udev(struct udev_queue *udev_queue)
-{
- if (udev_queue == NULL) {
- errno = EINVAL;
- return NULL;
- }
+_public_ struct udev *udev_queue_get_udev(struct udev_queue *udev_queue) {
+ assert_return_errno(udev_queue, NULL, EINVAL);
+
return udev_queue->udev;
}
@@ -238,7 +235,7 @@ _public_ int udev_queue_get_fd(struct udev_queue *udev_queue) {
_public_ int udev_queue_flush(struct udev_queue *udev_queue) {
int r;
- assert(udev_queue);
+ assert_return(udev_queue, -EINVAL);
if (udev_queue->fd < 0)
return -EINVAL;