newLISP Fan Club

Forum => newLISP in the real world => Topic started by: newdep on October 09, 2007, 12:22:05 PM

Title: Unused but reassigned signals..
Post by: newdep on October 09, 2007, 12:22:05 PM
Hi Lutz,



I ran into an issue where the Library I import also used SIGNALS which

newlisp has assigned but does not use. (execution of the library fails)

( first time i see this issue btw..)



Is it possible to remove the unassigned SIGNALS from the newlisp.c ?



These are never used inside the code of newlisp but are occupied...



/* setupSignalHandler(SIGALRM, signal_handler); */

/* setupSignalHandler(SIGVTALRM, signal_handler); */





Norman.
Title:
Post by: Lutz on October 09, 2007, 11:54:46 PM
Signals are initialized to a newLISP do-nothing operation. But I could add a a flag to the signal call (instaed of nil). Then the user can specify either SIG_IGN or  SIG_DFL at the beginning of a program to overwrite thid setting.



Perhaps you can try out if this works with your library and let me know?



setupSignalHandler(SIGALRM, SIG_IGN);
setupSignalHandler(SIGVTALRM, SIG_IGN);


Lutz
Title:
Post by: newdep on October 10, 2007, 12:26:30 AM
Hi Lutz,



I had a strange occeurance with that library lib, I had a mistake

in a function-call and the script stopped directly After the

message that the SIGVTALRM was already taken.



So its not an issue anymore, the lib runs (but with a warning now)

when using the old newlisp signaling way.  Your Hint did not

work though..the warning stays.. If I 100% unquote the signalhandlers

from the newlisp code then the warning is also gone.



Norman.
Title:
Post by: Lutz on October 10, 2007, 04:25:35 AM
In any case I will change the way the current nil flag is used in signal, just to give more options to the user in v9.2.4 without almost not adding any code code:


(signal sig-no handler-or-flag)

flag now will do a setup with SIG_IGN (ignore) when 'nil  and 'true will do a signal setup with SIG_DFL (OS default). Startup initialization will stay as before (necessary for SIGCHLD and SIGINT). This way all options are open when using the 'signal function. Before the flag could only be 'nil for an empty newLISP handler.



Lutz