Merge pull request #7573 from poettering/empty-to-null

use empty_to_null() where we can
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-12-07 21:04:53 +01:00
committed by GitHub
3 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
@@
expression s;
@@
- isempty(s) ? NULL : s
+ empty_to_null(s)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash -e
for SCRIPT in *.cocci ; do
for SCRIPT in ${@-*.cocci} ; do
[ "$SCRIPT" = "empty-if.cocci" ] && continue
echo "--x-- Processing $SCRIPT --x--"
TMPFILE=`mktemp`
+2 -2
View File
@@ -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);