chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loginctl: show pager also for status command
[elogind.git]
/
src
/
libudev
/
libudev-list.c
diff --git
a/src/libudev/libudev-list.c
b/src/libudev/libudev-list.c
index 1fe46f3f2838368ba459144e18757542c422ec2d..5d09b5d2d9ffd855ce74f466e67801886db6cd60 100644
(file)
--- a/
src/libudev/libudev-list.c
+++ b/
src/libudev/libudev-list.c
@@
-80,13
+80,9
@@
void udev_list_node_remove(struct udev_list_node *entry)
}
/* return list entry which embeds this node */
}
/* return list entry which embeds this node */
-static struct udev_list_entry *list_node_to_entry(struct udev_list_node *node)
+static
inline
struct udev_list_entry *list_node_to_entry(struct udev_list_node *node)
{
{
- char *list;
-
- list = (char *)node;
- list -= offsetof(struct udev_list_entry, node);
- return (struct udev_list_entry *)list;
+ return container_of(node, struct udev_list_entry, node);
}
void udev_list_init(struct udev *udev, struct udev_list *list, bool unique)
}
void udev_list_init(struct udev *udev, struct udev_list *list, bool unique)
@@
-190,6
+186,7
@@
struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
if (list->entries == NULL) {
free(entry->name);
free(entry->value);
if (list->entries == NULL) {
free(entry->name);
free(entry->value);
+ free(entry);
return NULL;
}
list->entries_max += add;
return NULL;
}
list->entries_max += add;