]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vconsole-setup: remember the correct error value when open_terminal() fails 30491/head
authorFranck Bui <fbui@suse.com>
Mon, 18 Dec 2023 11:47:21 +0000 (12:47 +0100)
committerFranck Bui <fbui@suse.com>
Mon, 18 Dec 2023 14:48:56 +0000 (15:48 +0100)
src/vconsole/vconsole-setup.c

index 4c28f43808b359a57747555e8f21089c22366f25..83e43b16ff98532661593e299da407075013c522 100644 (file)
@@ -537,22 +537,19 @@ static int find_source_vc(char **ret_path, unsigned *ret_idx) {
 
                 fd = open_terminal(path, O_RDWR|O_CLOEXEC|O_NOCTTY);
                 if (fd < 0) {
-                        log_debug_errno(fd, "Failed to open terminal %s, ignoring: %m", path);
-                        RET_GATHER(err, r);
+                        RET_GATHER(err, log_debug_errno(fd, "Failed to open terminal %s, ignoring: %m", path));
                         continue;
                 }
 
                 r = verify_vc_kbmode(fd);
                 if (r < 0) {
-                        log_debug_errno(r, "Failed to check VC %s keyboard mode: %m", path);
-                        RET_GATHER(err, r);
+                        RET_GATHER(err, log_debug_errno(r, "Failed to check VC %s keyboard mode: %m", path));
                         continue;
                 }
 
                 r = verify_vc_display_mode(fd);
                 if (r < 0) {
-                        log_debug_errno(r, "Failed to check VC %s display mode: %m", path);
-                        RET_GATHER(err, r);
+                        RET_GATHER(err, log_debug_errno(r, "Failed to check VC %s display mode: %m", path));
                         continue;
                 }