loop-util: let's cut trailing whitespace, not trailing lines

This doesn't really make any real difference, given the file should only
contain a single line. But it's conceptually more correct to just remove
the trailing newline/whitespace then the whole lines coming after that.
i.e. if the file actually contains more lines than one, this should
probably be considered an error.
This commit is contained in:
Lennart Poettering
2022-04-07 18:55:58 +02:00
parent cedf5b1aef
commit a145f8c06c
+1 -3
View File
@@ -62,9 +62,7 @@ static int get_current_uevent_seqnum(uint64_t *ret) {
if (r < 0)
return log_debug_errno(r, "Failed to read current uevent sequence number: %m");
truncate_nl(p);
r = safe_atou64(p, ret);
r = safe_atou64(strstrip(p), ret);
if (r < 0)
return log_debug_errno(r, "Failed to parse current uevent sequence number: %s", p);