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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user