Skip to content

Commit 90db158

Browse files
yuwatabluca
authored andcommitted
run/run: fix invocation ID handling
Fixes a regression introduced by 8157cc0.
1 parent 68ee2ba commit 90db158

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/run/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ static int acquire_invocation_id(sd_bus *bus, const char *unit, sd_id128_t *ret)
16101610
if (r < 0)
16111611
return bus_log_parse_error(r);
16121612

1613-
return 0;
1613+
return r; /* Return true when we get a non-null invocation ID. */
16141614
}
16151615

16161616
static void set_window_title(PTYForward *f) {

src/shared/bus-util.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,16 +914,15 @@ int bus_message_read_id128(sd_bus_message *m, sd_id128_t *ret) {
914914
case 0:
915915
if (ret)
916916
*ret = SD_ID128_NULL;
917-
break;
917+
return 0;
918918

919919
case sizeof(sd_id128_t):
920920
if (ret)
921921
memcpy(ret, a, sz);
922-
break;
922+
return !memeqzero(a, sz); /* This intends to sd_id128_is_null(), but ret may be NULL, so
923+
* let'suse memeqzero() here. */
923924

924925
default:
925926
return -EINVAL;
926927
}
927-
928-
return 0;
929928
}

0 commit comments

Comments
 (0)