summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-03-22 22:48:23 +0100
committerBruno Haible <bruno@clisp.org>2021-03-22 22:48:23 +0100
commit83c222f7a65279e4e659a4caf8b85d34f91d5eeb (patch)
tree9a57b0ec52989a98acdfdd22ef5f55f1aea9dcbe /modules
parentfe8e6696806c54dd0f0e15f6d3464241f529d874 (diff)
downloadgnulib-83c222f7a65279e4e659a4caf8b85d34f91d5eeb.tar.gz
clean-temp-simple: New module.
* lib/clean-temp-simple.h: New file, based on lib/clean-temp.h. * lib/clean-temp-private.h: New file, based on lib/clean-temp.c. * lib/clean-temp-simple.c: New file, based on lib/clean-temp.c. * lib/clean-temp.h: Include clean-temp-simple.h. (register_temporary_file, unregister_temporary_file, cleanup_temporary_file): Remove declarations. * lib/clean-temp.c: Don't include <limits.h>, <stdint.h>. Include <signal.h>, <stdio.h>, clean-temp-simple.h, clean-temp-private.h. (file_cleanup_list_lock, file_cleanup_list): Moved to clean-temp-simple.c. (struct tempdir, dir_cleanup_list, struct closeable_fd, descriptors): Moved to clean-temp-private.h. (string_equals, SIZE_BITS, string_hash, fatal_signal_set, init_fatal_signal_set, asyncsafe_close): Moved to clean-temp-simple.c. (asyncsafe_fclose_variant): Use get_fatal_signal_set() here. (cleanup_action, do_init_clean_temp, clean_temp_once, init_clean_temp, register_temporary_file, unregister_temporary_file, do_unlink, cleanup_temporary_file): Moved to clean-temp-simple.c. (create_temp_dir, cleanup_temp_file, cleanup_temp_dir_contents, gen_register_open_temp, close_temp): Update for changed function names. (fclose_variant_temp): Don't call init_fatal_signal_set(). * modules/clean-temp-simple: New file, based on modules/clean-temp. * modules/clean-temp (Depends-on): Add clean-temp-simple, list. Remove stdint. (configure.ac): Don't define SIGNAL_SAFE_LIST here.
Diffstat (limited to 'modules')
-rw-r--r--modules/clean-temp6
-rw-r--r--modules/clean-temp-simple42
2 files changed, 45 insertions, 3 deletions
diff --git a/modules/clean-temp b/modules/clean-temp
index 2eca0060a7..a83f249903 100644
--- a/modules/clean-temp
+++ b/modules/clean-temp
@@ -8,13 +8,14 @@ lib/clean-temp.c
Depends-on:
c99
stdbool
-stdint
+clean-temp-simple
+list
+asyncsafe-spin
unistd
lock
thread-optim
error
fatal-signal
-asyncsafe-spin
open
pathmax
tmpdir
@@ -29,7 +30,6 @@ xlist
gettext-h
configure.ac:
-AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.])
Makefile.am:
lib_SOURCES += clean-temp.h clean-temp.c
diff --git a/modules/clean-temp-simple b/modules/clean-temp-simple
new file mode 100644
index 0000000000..4187ee62ab
--- /dev/null
+++ b/modules/clean-temp-simple
@@ -0,0 +1,42 @@
+Description:
+Temporary files with automatic cleanup.
+
+Files:
+lib/clean-temp-simple.h
+lib/clean-temp-private.h
+lib/clean-temp-simple.c
+
+Depends-on:
+c99
+stdbool
+list
+asyncsafe-spin
+unistd
+lock
+thread-optim
+error
+fatal-signal
+rmdir
+xalloc
+xalloc-die
+linkedhash-list
+xlist
+gettext-h
+
+configure.ac:
+AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.])
+
+Makefile.am:
+lib_SOURCES += clean-temp-simple.h clean-temp-simple.c
+
+Include:
+"clean-temp-simple.h"
+
+Link:
+$(LIBTHREAD)
+
+License:
+GPL
+
+Maintainer:
+all