mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
core: use empty_to_null() where we can
This commit is contained in:
parent
3708254f36
commit
a8ea93a5e2
5
coccinelle/empty-to-null.cocci
Normal file
5
coccinelle/empty-to-null.cocci
Normal file
|
@ -0,0 +1,5 @@
|
|||
@@
|
||||
expression s;
|
||||
@@
|
||||
- isempty(s) ? NULL : s
|
||||
+ empty_to_null(s)
|
|
@ -3015,8 +3015,8 @@ static int signal_name_owner_changed(sd_bus_message *message, void *userdata, sd
|
|||
return 0;
|
||||
}
|
||||
|
||||
old_owner = isempty(old_owner) ? NULL : old_owner;
|
||||
new_owner = isempty(new_owner) ? NULL : new_owner;
|
||||
old_owner = empty_to_null(old_owner);
|
||||
new_owner = empty_to_null(new_owner);
|
||||
|
||||
if (UNIT_VTABLE(u)->bus_name_owner_change)
|
||||
UNIT_VTABLE(u)->bus_name_owner_change(u, name, old_owner, new_owner);
|
||||
|
|
Loading…
Reference in a new issue