summaryrefslogtreecommitdiffstats
path: root/debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch')
-rw-r--r--debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch b/debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch
new file mode 100644
index 0000000..08281af
--- /dev/null
+++ b/debian/patches/upstream/0013-sfdisk-inform-about-failed-fsync-coverity-scan.patch
@@ -0,0 +1,25 @@
+From: Karel Zak <kzak@redhat.com>
+Date: Thu, 11 Aug 2022 13:14:18 +0200
+Subject: [PATCH 13/24] sfdisk: inform about failed fsync() [coverity scan]
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ disk-utils/sfdisk.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
+index 112bc7c..0e85e63 100644
+--- a/disk-utils/sfdisk.c
++++ b/disk-utils/sfdisk.c
+@@ -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 */