jsonrpc-c icon indicating copy to clipboard operation
jsonrpc-c copied to clipboard

Calling exit() from a library discouraged

Open hsanjuan opened this issue 9 years ago • 0 comments

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.

hsanjuan avatar Jun 04 '15 11:06 hsanjuan