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:
parent
4dfdda9e78
commit
95f4d1d682
2
main.go
2
main.go
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user