Skip to content

Conversation

@LorenzoPegorari
Copy link

Some of the gotos statements in this file make sense, particularly for reducing the LOC count.

goto failed and goto fatal though, in my opinion, do not make sense.

What's the point of having a goto statement that handles a failure by simply returning -1? Simply do return -1; instead without the goto.

Also, the line errno = ENOTTY; is useless and confusing:

  • it sets errno to a specific value when an error happens, but errno should already be set to the correct value (the one that represents the encountered error),
  • this errno is not used.

This is confusing. Again, just do return -1; instead without the goto.

(with love from Cremona <3 @antirez )

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