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

Calling exit() from a library discouraged #14

Closed
hsanjuan opened this issue Jun 4, 2015 · 0 comments
Closed

Calling exit() from a library discouraged #14

hsanjuan opened this issue Jun 4, 2015 · 0 comments

Comments

@hsanjuan
Copy link

hsanjuan commented Jun 4, 2015

When packaging this as rpm, rpmlint report states:

[   53s] libjsonrpcc0.x86_64: W: shared-lib-calls-exit /usr/lib64/libjsonrpcc.so.0.0.0 exit@GLIBC_2.2.5
[   53s] This library package calls exit() or _exit(), probably in a non-fork()
[   53s] context. Doing so from a library is strongly discouraged - when a library
[   53s] function calls exit(), it prevents the calling program from handling the
[   53s] error, reporting it to the user, closing files properly, and cleaning up any
[   53s] state that the program has. It is preferred for the library to return an
[   53s] actual error code and let the calling program decide how to handle the
[   53s] situation." 

which sounds a sensible thing to do.

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

No branches or pull requests

2 participants