I'd rather join this function with `RegisterSignalHandler`. They clearly feel duplicated now. Adding a third boolean or enum argument should be better, imho.