Skip to content

Commit

Permalink
Change the way seek errors are dealt for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
1lann committed Jan 17, 2020
1 parent e12af2f commit ccd91ec
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions recording/recording.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,13 @@ func NewRecording(file io.ReadWriteSeeker) (*Recording, error) {
func (r *Recording) readHeaderUnit16(offset int) (uint16, int, error) {
pos, err := r.file.Seek(int64(offset), 2)
if err != nil {
if pathErr, ok := err.(*os.PathError); ok {
if pathErr.Err == syscall.EINVAL {
// Cannot seek to this point, declare data as missing
return 0, 0, ErrMissingData
}
}

return 0, 0, err
// if pathErr, ok := err.(*os.PathError); ok {
// if pathErr.Err == syscall.EINVAL {
// // Cannot seek to this point, declare data as missing
// return 0, 0, ErrMissingData
// }
// }
return 0, 0, ErrMissingData
}

var number uint16
Expand Down

0 comments on commit ccd91ec

Please sign in to comment.