I'd keep an int flag, initialized to zero.
If you do, your code is buggy: sig_atomic_t is the only type you can safely use inside and outside a signal handler.
If you do, your code is buggy: sig_atomic_t is the only type you can safely use inside and outside a signal handler.