1
0
mirror of https://github.com/byReqz/go-etcher.git synced 2024-11-22 15:01:16 +00:00

fix blockdevices being unwritable

This commit is contained in:
Nils 2022-02-07 12:21:51 +01:00
parent 4dfdda9e78
commit 95f4d1d682
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

View File

@ -204,6 +204,7 @@ func main() {
} else { } else {
inputsize, err = image.Seek(0, io.SeekEnd) inputsize, err = image.Seek(0, io.SeekEnd)
inputisblock = true inputisblock = true
_, _ = image.Seek(0, 0)
} }
target, err := os.OpenFile(device, os.O_RDWR, 0660) target, err := os.OpenFile(device, os.O_RDWR, 0660)
if err != nil { if err != nil {
@ -219,6 +220,7 @@ func main() {
} else { } else {
targetsize, err = target.Seek(0, io.SeekEnd) targetsize, err = target.Seek(0, io.SeekEnd)
targetisblock = true targetisblock = true
_, _ = target.Seek(0, 0)
} }
if err != nil { if err != nil {
s.Stop() s.Stop()