From: Lennart Poettering Date: Mon, 28 Jan 2019 16:32:46 +0000 (+0100) Subject: bootctl: use SYNTHETIC_ERRNO() where appropriate X-Git-Tag: v242-rc1~218^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78d5d4ed77b53ae1aab49a9e5e0b6949a875db68;p=thirdparty%2Fsystemd.git bootctl: use SYNTHETIC_ERRNO() where appropriate --- diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index dc2fd96628b..1dbe00adb64 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -112,8 +112,7 @@ static int get_file_version(int fd, char **v) { e = memmem(s, st.st_size - (s - buf), " ####", 5); if (!e || e - s < 3) { - log_error("Malformed version string."); - r = -EINVAL; + r = log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Malformed version string."); goto finish; } @@ -386,10 +385,8 @@ static int version_check(int fd_from, const char *from, int fd_to, const char *t "Skipping \"%s\", since it's owned by another boot loader.", to); - if (compare_version(a, b) < 0) { - log_warning("Skipping \"%s\", since a newer boot loader version exists already.", to); - return -ESTALE; - } + if (compare_version(a, b) < 0) + return log_warning_errno(SYNTHETIC_ERRNO(ESTALE), "Skipping \"%s\", since a newer boot loader version exists already.", to); return 0; }