core: use device_found_to_string_many() result only on success

This commit is contained in:
Lennart Poettering 2018-06-04 18:03:57 +02:00
parent 6e0f878ee2
commit 43ba7d71e5
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}