We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f2a241 commit eadcb1bCopy full SHA for eadcb1b
1 file changed
src/client.c
@@ -245,11 +245,8 @@ const char* rimraf_tmpdir_cmd = NULL;
245
void term_handler(int n) {
246
R_system(rimraf_tmpdir_cmd);
247
248
- // We don't run finalization handlers because running R code from a
249
- // signal handler is not safe. To properly clean up a process, we'd
250
- // need R to handle SIGTERM and clean up at check-interrupt
251
- // time. We do run `atexit()` handlers though.
252
- exit(-SIGTERM);
+ // Continue signal
+ raise(SIGTERM);
253
}
254
255
void install_term_handler(void) {
@@ -286,6 +283,7 @@ void install_term_handler(void) {
286
283
287
284
struct sigaction sig = {{ 0 }};
288
285
sig.sa_handler = term_handler;
+ sig.sa_flags = SA_RESETHAND;
289
sigaction(SIGTERM, &sig, NULL);
290
291
0 commit comments