Skip to content

Commit

Permalink
Reset vKeyboard file descriptor after a successful Close() operation
Browse files Browse the repository at this point in the history
  • Loading branch information
ghthor committed Aug 30, 2016
1 parent 1ab6dec commit 802b84a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion uinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ func (vk *VKeyboard) Close() (err error) {
if vk.id < 0 {
return errors.New("Keyboard not initialized. Closing device failed.")
}
return closeDevice(vk.id)

err = closeDevice(vk.id)
if err != nil {
return err
}

vk.id = -1
return nil
}

func createVKeyboardDevice(path, name string) (deviceId int, err error) {
Expand Down

0 comments on commit 802b84a

Please sign in to comment.