From: Lennart Poettering Date: Tue, 5 Apr 2022 14:58:32 +0000 (+0200) Subject: loop-util: let's cut trailing whitespace, not trailing lines X-Git-Tag: v251-rc2~165^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a145f8c06c354328b4a6ed8a7621c4b21cbca05b;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 6356ff44d8c..026adf070d3 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -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);