chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
man: document sd_journal_get_cursor()
[elogind.git]
/
src
/
libudev
/
libudev-device.c
diff --git
a/src/libudev/libudev-device.c
b/src/libudev/libudev-device.c
index 9ef4610a6af99e2bd77fb42ddbd4207931b7b239..a8277d1363dc4b039d20dd6a01bd4c1edee5f337 100644
(file)
--- a/
src/libudev/libudev-device.c
+++ b/
src/libudev/libudev-device.c
@@
-1022,14
+1022,15
@@
_public_ struct udev_device *udev_device_ref(struct udev_device *udev_device)
* Drop a reference of a udev device. If the refcount reaches zero,
* the resources of the device will be released.
*
* Drop a reference of a udev device. If the refcount reaches zero,
* the resources of the device will be released.
*
+ * Returns: the passed udev device if it has still an active reference, or #NULL otherwise.
**/
**/
-_public_
void
udev_device_unref(struct udev_device *udev_device)
+_public_
struct udev_device *
udev_device_unref(struct udev_device *udev_device)
{
if (udev_device == NULL)
{
if (udev_device == NULL)
- return;
+ return
NULL
;
udev_device->refcount--;
if (udev_device->refcount > 0)
udev_device->refcount--;
if (udev_device->refcount > 0)
- return;
+ return
udev_device
;
if (udev_device->parent_device != NULL)
udev_device_unref(udev_device->parent_device);
free(udev_device->syspath);
if (udev_device->parent_device != NULL)
udev_device_unref(udev_device->parent_device);
free(udev_device->syspath);
@@
-1049,6
+1050,7
@@
_public_ void udev_device_unref(struct udev_device *udev_device)
free(udev_device->envp);
free(udev_device->monitor_buf);
free(udev_device);
free(udev_device->envp);
free(udev_device->monitor_buf);
free(udev_device);
+ return NULL;
}
/**
}
/**