diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-21 06:06:41 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-22 15:49:55 +0100 |
commit | fd05c424c0d781ba0e86700095c61938339df991 (patch) | |
tree | 054443397b686506d59578730b82c9d6c55b4915 /src/libudev/libudev-queue.c | |
parent | test: add tests for libudev-list (diff) | |
download | systemd-fd05c424c0d781ba0e86700095c61938339df991.tar.xz systemd-fd05c424c0d781ba0e86700095c61938339df991.zip |
libudev: introduce return_with_errno() and use it where applicable
Diffstat (limited to 'src/libudev/libudev-queue.c')
-rw-r--r-- | src/libudev/libudev-queue.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libudev/libudev-queue.c b/src/libudev/libudev-queue.c index 60a84cb03b..4e055bbc37 100644 --- a/src/libudev/libudev-queue.c +++ b/src/libudev/libudev-queue.c @@ -46,10 +46,8 @@ _public_ struct udev_queue *udev_queue_new(struct udev *udev) { struct udev_queue *udev_queue; udev_queue = new(struct udev_queue, 1); - if (!udev_queue) { - errno = ENOMEM; - return NULL; - } + if (!udev_queue) + return_with_errno(NULL, ENOMEM); *udev_queue = (struct udev_queue) { .udev = udev, @@ -188,8 +186,7 @@ _public_ int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, un * Returns: NULL. **/ _public_ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue) { - errno = ENODATA; - return NULL; + return_with_errno(NULL, ENODATA); } /** |