diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-07-06 17:01:11 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-07-06 17:01:11 +0200 |
commit | 5433b7320ee15e360fa2a60a3cdba9f17d51ec48 (patch) | |
tree | 39f8f8d24f98a9f3d12f312c58ec338521d8b450 /libudev | |
parent | 665a754d03aa21a6ff58066abe125569a4bc32c2 (diff) |
libudev: device - export udev_device_has_tag()
Diffstat (limited to 'libudev')
-rw-r--r-- | libudev/libudev-device.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c index 1ac0760f9e..1d4cb704c2 100644 --- a/libudev/libudev-device.c +++ b/libudev/libudev-device.c @@ -1646,17 +1646,18 @@ UDEV_EXPORT struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_ return udev_list_get_entry(&udev_device->tags_list); } -int udev_device_has_tag(struct udev_device *udev_device, const char *tag) +UDEV_EXPORT int udev_device_has_tag(struct udev_device *udev_device, const char *tag) { struct udev_list_entry *list_entry; + if (udev_device == NULL) + return NULL; if (!udev_device->info_loaded) udev_device_read_db(udev_device, NULL); list_entry = udev_device_get_tags_list_entry(udev_device); - list_entry = udev_list_entry_get_by_name(list_entry, tag); - if (list_entry != NULL) - return 1; - return 0; + if (udev_list_entry_get_by_name(list_entry, tag) != NULL) + return true; + return false; } #define ENVP_SIZE 128 |