]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: fix error propagation in add_root_mount()
authordongshengyuan <545258830@qq.com>
Tue, 16 Jun 2026 01:07:25 +0000 (09:07 +0800)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 16 Jun 2026 08:26:23 +0000 (10:26 +0200)
When generator_write_initrd_root_device_deps() fails, the error was
swallowed by returning 0 (success) instead of r. The two subsequent
calls in the same block correctly return r on failure.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
Co-developed-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
src/gpt-auto-generator/gpt-auto-generator.c

index abbb955e5992e137ec6f5b5b311a0558cdc1d824..b92ac8f66a765762a7f439107331fda1153be3ed 100644 (file)
@@ -882,7 +882,7 @@ static int add_root_mount(void) {
         if (in_initrd()) {
                 r = generator_write_initrd_root_device_deps(arg_dest_late, bdev);
                 if (r < 0)
-                        return 0;
+                        return r;
 
                 r = add_root_cryptsetup();
                 if (r < 0)