From 43ba7d71e550908be101c6d00eb3e8f0e372db4e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 4 Jun 2018 18:03:57 +0200 Subject: [PATCH] core: use device_found_to_string_many() result only on success --- src/core/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index 30707d07a75..9d09a219d5d 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -222,8 +222,8 @@ static int device_serialize(Unit *u, FILE *f, FDSet *fds) { unit_serialize_item(u, f, "state", device_state_to_string(d->state)); - (void) device_found_to_string_many(d->found, &s); - unit_serialize_item(u, f, "found", s); + if (device_found_to_string_many(d->found, &s) >= 0) + unit_serialize_item(u, f, "found", s); return 0; } -- 2.39.5