Skip to content

Commit

Permalink
Added error-check on terminal restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Apr 14, 2024
1 parent 9d0ac51 commit 402ef86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpm/cpm_syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ func SysCallReadChar(cpm *CPM) error {
}

// restore the state of the terminal to avoid mixing RAW/Cooked
term.Restore(int(os.Stdin.Fd()), oldState)
err = term.Restore(int(os.Stdin.Fd()), oldState)
if err != nil {
return fmt.Errorf("error restoring terminal state %s", err)
}

// Return the character
cpm.CPU.States.AF.Hi = b[0]
Expand Down

0 comments on commit 402ef86

Please sign in to comment.