That question didn't show an answer to my problem but yes it answered 1
I read that doing the following isn't safe in C++:
int main() {
signal(SIGTSTP, ctrlZHandler) == SIG_ERR
}
void ctrlZHandler(int sig_num) {
std::cout << "got ctrl-Z" << std::endl;//THIS ISN'T SAFE!
route_signal(sig_num);
}
why this isn't correct/safe?
In case I want to fix it, is it helpful if I remove the printing of "got ctrl-Z" inside route_signal function?