]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: inform about failed fsync() [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 11 Aug 2022 11:14:18 +0000 (13:14 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 11 Aug 2022 11:14:18 +0000 (13:14 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 112bc7c61c7b0869aa968f0c73da36314cefcaa2..0e85e63bb33fe4a724808eb41cf45124c8dc3115 100644 (file)
@@ -566,8 +566,9 @@ static int move_partition_data(struct sfdisk *sf, size_t partno, struct fdisk_pa
                                ioerr++;
                                goto next;
                        }
-                       if (sf->movefsync)
-                               fsync(fd);
+                       if (sf->movefsync && fsync(fd) != 0)
+                               fdisk_warn(sf->cxt,
+                                       _("cannot fsync at offset: %ju; continue"), dst);
                }
 
                /* write log */