#: 12180 S12/OS9/68000 (OSK)
11-Sep-91 09:47:44
Sb: #12171-#Intercepts
Fm: Mark Wuest 74030,332
To: Bob van der Poel 76510,2203 (X)
Bob,
I have one process (a daemon) that gets a signal every night at midnight, does
an fclose() and fopen() on a log file, and returns. Since the file is a log
file, I figure we can risk missing a signal while we're switching (especially
since we shouldn't be getting any other signals!). It has run flawlessly for
over a year now in several places.
I know this is going to sound funny, but I would try to talk you out of the
longjmp() you are doing and replace it with chain(), using the argv, argc, and
envp you were passes in main(). This will close() all your files (the system
will do it for you) and be more assuring of stacks, etc, being in kosher shape.
Call me paranoid, but at best your code is not going to be easily portable to
Unix (where your would replace chain() with a fork(), exec(), "am I the parent"
decision, and exit()).
Just food for thought. OTOH, if it ain't broke, don't fix it might apply here,
too.
Mark
There is 1 Reply.
|