diff options
author | Bruno Haible <bruno@clisp.org> | 2020-07-04 14:39:09 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-07-04 14:39:09 +0200 |
commit | 9d1ad9c4df04071810d04dcc3142dfdeb5a5f892 (patch) | |
tree | d59713b40bf8cc09eea58ba1545bf0009f390600 /modules/clean-temp | |
parent | 856995cf27edc742b6aa34fd54466d2c4ed50329 (diff) | |
download | gnulib-9d1ad9c4df04071810d04dcc3142dfdeb5a5f892.tar.gz |
clean-temp: Make multithread-safe, part 2.
* lib/fatal-signal.h: Include <signal.h>.
(get_fatal_signal_set): New declaration.
* lib/fatal-signal.c (get_fatal_signal_set): New function.
* lib/clean-temp.c: Include asyncsafe-spin.h, gl_linked_list.h.
(struct closeable_fd): New type.
(fatal_signal_set): New variable.
(init_fatal_signal_set): New function.
(asyncsafe_close, asyncsafe_fclose_variant): New functions.
(cleanup_action): Invoke asyncsafe_close instead of close.
(create_temp_dir): Invoke init_fatal_signal_set.
(register_fd): Use a plain linked list. Add a 'struct closeable_fd *'
element.
(unregister_fd): Remove function.
(close_temp): Cleanup descriptors list on the fly. Invoke
init_fatal_signal_set. Invoke asyncsafe_close instead of close.
(fclose_variant_temp): New function.
(fclose_temp, fwriteerror_temp, close_stream_temp): Use it.
* modules/clean-temp (Depends-on): Add asyncsafe-spin, linked-list.
Diffstat (limited to 'modules/clean-temp')
-rw-r--r-- | modules/clean-temp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/clean-temp b/modules/clean-temp index c1d5c1c4b5..940869de4e 100644 --- a/modules/clean-temp +++ b/modules/clean-temp @@ -12,6 +12,7 @@ unistd lock error fatal-signal +asyncsafe-spin open pathmax tmpdir @@ -20,6 +21,7 @@ rmdir xalloc xmalloca linkedhash-list +linked-list xlist gettext-h |