[systemd-devel] [PATCH] sd-bus: use isempty() consistently

Daniel Mack daniel at zonque.org
Mon Jul 20 03:14:22 PDT 2015


On 07/19/2015 11:01 AM, Namhyung Kim wrote:
> Signed-off-by: Namhyung Kim <namhyung at gmail.com>

Looks good, thanks! However, it does not apply against current master.
Care to rebase? Also, we generally prefer GitHub pull requests these
days. And you can leave off the Signed-off-by line, we don't use that in
the systemd project.


Thanks,
Daniel


> ---
>  src/libsystemd/sd-bus/bus-control.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
> index a38c5c5..80f4760 100644
> --- a/src/libsystemd/sd-bus/bus-control.c
> +++ b/src/libsystemd/sd-bus/bus-control.c
> @@ -1131,7 +1131,7 @@ static int add_name_change_match(sd_bus *bus,
>  
>                  /* If the old name is unset or empty, then
>                   * this can match against added names */
> -                if (!old_owner || old_owner[0] == 0) {
> +                if (isempty(old_owner)) {
>                          item->type = KDBUS_ITEM_NAME_ADD;
>  
>                          r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
> @@ -1141,7 +1141,7 @@ static int add_name_change_match(sd_bus *bus,
>  
>                  /* If the new name is unset or empty, then
>                   * this can match against removed names */
> -                if (!new_owner || new_owner[0] == 0) {
> +                if (isempty(new_owner)) {
>                          item->type = KDBUS_ITEM_NAME_REMOVE;
>  
>                          r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
> @@ -1185,7 +1185,7 @@ static int add_name_change_match(sd_bus *bus,
>  
>                  /* If the old name is unset or empty, then this can
>                   * match against added ids */
> -                if (!old_owner || old_owner[0] == 0) {
> +                if (isempty(old_owner)) {
>                          item->type = KDBUS_ITEM_ID_ADD;
>  
>                          r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
> @@ -1195,7 +1195,7 @@ static int add_name_change_match(sd_bus *bus,
>  
>                  /* If thew new name is unset or empty, then this can
>                   * match against removed ids */
> -                if (!new_owner || new_owner[0] == 0) {
> +                if (isempty(new_owner)) {
>                          item->type = KDBUS_ITEM_ID_REMOVE;
>  
>                          r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
> 



More information about the systemd-devel mailing list