From: Lennart Poettering Date: Thu, 7 Dec 2017 11:13:00 +0000 (+0100) Subject: core: use empty_to_null() where we can X-Git-Tag: v236~42^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8ea93a5e2a5d6cc2d448a42c265bac2408e0b21;p=platform%2Fupstream%2Fsystemd.git core: use empty_to_null() where we can --- diff --git a/coccinelle/empty-to-null.cocci b/coccinelle/empty-to-null.cocci new file mode 100644 index 0000000..fbc75b9 --- /dev/null +++ b/coccinelle/empty-to-null.cocci @@ -0,0 +1,5 @@ +@@ +expression s; +@@ +- isempty(s) ? NULL : s ++ empty_to_null(s) diff --git a/src/core/unit.c b/src/core/unit.c index ed0cf02..7af8425 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -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);