Skip to content

Conversation

@bw31642
Copy link
Contributor

@bw31642 bw31642 commented Oct 20, 2022

make initX11() return 0 in the event of dlopen failing. This allows the test for failure in clipboard_test() to work as expected.

@changkun
Copy link
Member

I am not sure why this is a bug. Returning -1 indicates there is something wrong with the system, and we should not proceed with using the package. Are you saying that without loading libX11.so, the package can still work as expected?

@bw31642
Copy link
Contributor Author

bw31642 commented Oct 26, 2022

I'm saying the test in the function clipboard_test() of clipboard_linux.c needs a 0 to get to the return -1. 0 is the only value that means false.
int clipboard_test() {
if (!initX11()) { <----------- This needs a return value of 0 to get to the return -1
return -1;
}
If you test the code when libX11.so is not available, you can observe the error.

Copy link
Member

@changkun changkun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@changkun changkun merged commit 64c2cf5 into golang-design:main Oct 28, 2022
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.

2 participants