The cast is not necessary here, that's only relevant in the signal handler.