[zeromq-dev] czmq v3.0.0: zsys_handler_set - different semantics from v2 API
Michael Haberler
mail17 at mah.priv.at
Wed May 20 10:14:50 CEST 2015
> Am 20.05.2015 um 08:53 schrieb Pieter Hintjens <ph at imatix.com>:
>
> Looks good to me. Thanks!
hm, it seems I'm unable to create a PR against a commit/tag: https://github.com/zeromq/czmq/compare/9c24aea3defe84cd72d7e6ac1845b6215f3d7aad...mhaberler:v3.0.0-work
not sure how to proceed?
- Michael
>
> On Wed, May 20, 2015 at 8:00 AM, Michael Haberler <mail17 at mah.priv.at> wrote:
>> in czmq v2.x, if you did a zsys_handler_set(NULL) at the beginning of the program, czmq would refrain from _any_ signal handling which is what I need (I do that synchronously with signalfd for those signals which can be trapped by signalfd)
>>
>> v3.0.0 outsmarts me by insisting on calling zsys_catch_interrupts() from zsys_init() if ZSYS_SIGHANDLER is not set, and that interferes with signalfd handling
>>
>> I guess the proper way would be to call zsys_catch_interrupts() ONLY if s_first_time is true
>>
>> if agreed, I'll prepare a PR
>>
>> - Michael
>>
>> @@ -160,12 +160,12 @@ zsys_init (void)
>> else
>> if (streq (getenv ("ZSYS_LOGSYSTEM"), "false"))
>> s_logsystem = false;
>> }
>> // Catch SIGINT and SIGTERM unless ZSYS_SIGHANDLER=false
>> - if ( getenv ("ZSYS_SIGHANDLER") == NULL
>> - || strneq (getenv ("ZSYS_SIGHANDLER"), "false"))
>> + if (( getenv ("ZSYS_SIGHANDLER") == NULL
>> + || strneq (getenv ("ZSYS_SIGHANDLER"), "false")) && s_first_time)
>> zsys_catch_interrupts ();
>>
>> ZMUTEX_INIT (s_mutex);
>> s_sockref_list = zlist_new ();
>> if (!s_sockref_list) {
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list