Skip to content

Comments

reader: graceful syscall.Read error handling#6

Open
piec wants to merge 1 commit intos-urbaniak:masterfrom
eshard:master
Open

reader: graceful syscall.Read error handling#6
piec wants to merge 1 commit intos-urbaniak:masterfrom
eshard:master

Conversation

@piec
Copy link

@piec piec commented Jan 10, 2022

Hi,

I'm using s-urbaniak/uevent and in some cases syscall.Read returns: (n:-1, err: ENOBUFS "no buffer space available").
bufio.(*Reader).ReadString & subcalls don't like the -1 too much and panic: source
It handles correctly the error if n=0 and err != nil though.
This PR changes the -1 to 0 in case of error.

Best regards,
Pierre

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.

1 participant