Nice suggestion, thanks! I pushed something similar reusing the dryrun
variable, and -N because I like to reserve -t for timeouts. Please test
and check that it's working for you.
>+ script_free(script, scriptlen, envmatch, envmatchlen) ;
That freeing is unnecessary because the program exits right away.
The script_free function only exists because SIGHUP will make mdevd
reload its configuration file, so the heap allocations need to be freed
before new ones are performed. Normally I'd do that in the bottom half
of the SIGHUP handler, but mdevd also doubles as a "use as little static
and heap data as possible" experiment, so the script itself lives in
the stack, which is why you see the freeing function invoked in the
outer loop instead.
--
Laurent
Received on Sun Jun 01 2025 - 12:15:01 CEST