From 95f4d1d682a64fbc556f22ff4601c5361a57a889 Mon Sep 17 00:00:00 2001 From: Nils Date: Mon, 7 Feb 2022 12:21:51 +0100 Subject: [PATCH] fix blockdevices being unwritable --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 62d5875..b010b6d 100644 --- a/main.go +++ b/main.go @@ -204,6 +204,7 @@ func main() { } else { inputsize, err = image.Seek(0, io.SeekEnd) inputisblock = true + _, _ = image.Seek(0, 0) } target, err := os.OpenFile(device, os.O_RDWR, 0660) if err != nil { @@ -219,6 +220,7 @@ func main() { } else { targetsize, err = target.Seek(0, io.SeekEnd) targetisblock = true + _, _ = target.Seek(0, 0) } if err != nil { s.Stop()