]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: use right error variable
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Oct 2021 12:10:27 +0000 (14:10 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Oct 2021 18:41:35 +0000 (19:41 +0100)
src/partition/repart.c

index 564ee4835bc7fffac91d8e5b2e79e5c5db0b54d1..bfd9896f7115ec763aabe274ab02ccaf8028b5c5 100644 (file)
@@ -2779,7 +2779,7 @@ static int context_copy_blocks(Context *context) {
                         return log_error_errno(r, "Failed to copy in data from '%s': %m", p->copy_blocks_path);
 
                 if (fsync(target_fd) < 0)
-                        return log_error_errno(r, "Failed to synchronize copied data blocks: %m");
+                        return log_error_errno(errno, "Failed to synchronize copied data blocks: %m");
 
                 if (p->encrypt != ENCRYPT_OFF) {
                         encrypted_dev_fd = safe_close(encrypted_dev_fd);
@@ -3055,7 +3055,7 @@ static int context_mkfs(Context *context) {
 
                 if (p->encrypt != ENCRYPT_OFF) {
                         if (fsync(encrypted_dev_fd) < 0)
-                                return log_error_errno(r, "Failed to synchronize LUKS volume: %m");
+                                return log_error_errno(errno, "Failed to synchronize LUKS volume: %m");
                         encrypted_dev_fd = safe_close(encrypted_dev_fd);
 
                         r = deactivate_luks(cd, encrypted);