Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serial_unix.go: Keep writing until complete #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ccollins476ad
Copy link

Fixes #191.

Change unix port.Write() implementation to match io.Writer requirement:

Write must return a non-nil error if it returns n < len(p)

Keep executing write syscall until failure or entire buffer is written.

Fixes bugst#191.

Change unix port.Write() implementation to match io.Writer requirement:
> Write must return a non-nil error if it returns n < len(p)

Keep executing write syscall until failure or entire buffer is written.
@richyo-work
Copy link

richyo-work commented Sep 16, 2024

I seem to be experiencing this same issue on a specific piece of hardware / uart. Write reports 5 bytes, and only wrote 2 bytes. Obviously this is very frustrating and should be fixed. I will test this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port.Write() returns nil error after partial write; does not adhere to the io.Writer contract
2 participants