On 2013-10-21 7:21 PM, Kristian Evensen wrote: > Hi, > > On Mon, Oct 21, 2013 at 5:31 PM, Felix Fietkau <n...@openwrt.org> wrote: >> bool is a more appropriate type here than uint8_t > > Thanks for letting me know. > >> I think you need to use a different approach. What you're doing here >> breaks recursive uloop_run calls, which are used in a few places. >> You need to change the code to save/restore signal handlers instead of >> just setting them to NULL. > > Thanks for your comments. The more I think about this, the more I > believe that this is better dealt with by the user applications. One > simple approach would be to store the old sigaction (when entering > uloop first time) somewhere, and only guarantee that signal handling > is restored to what it was when uloop_run() was called the first time. > However, this would not cover all cases. Since you allow recursive > calls, I guess we have to store the signal handler + flags for each > call, to make sure no information is lost. Would approach one be > sufficient, or is number two required? I think storing the signal handler once and skipping the apply/restore for recursive calls should work. You could use a simple static counter to track the recursion level.
- Felix _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel