From 391c29f5bb99a4a77d19ece68e52623d4890676a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 23 Mar 2021 00:08:38 +0100 Subject: clean-temp-simple: Remove dependency upon xalloc, xalloc-die, xlist. * lib/clean-temp-private.h (clean_temp_init): Change return type to 'int'. * lib/clean-temp-simple.h (register_temporary_file): Change return type to 'int'. * lib/clean-temp-simple.c: Don't include xalloc.h, gl_xlist.h. Include gl_list.h instead. (init_failed): New variable. (do_clean_temp_init): Set it. (clean_temp_init): Return an error indicator. (register_temporary_file): Invoke gl_list_nx_create_empty instead of gl_list_create_empty. Invoke strdup instead of xstrdup. Invoke gl_list_nx_add_first instead of gl_list_add_first. Return an error indicator. * lib/clean-temp.c (create_temp_dir, gen_register_open_temp): Call xalloc_die() if clean_temp_init or register_temporary_file failed. * modules/clean-temp-simple (Depends-on): Remove xalloc, xalloc-die, xlist. --- lib/clean-temp-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/clean-temp-private.h') diff --git a/lib/clean-temp-private.h b/lib/clean-temp-private.h index 655eb3fbbf..46dba23dd3 100644 --- a/lib/clean-temp-private.h +++ b/lib/clean-temp-private.h @@ -75,7 +75,7 @@ extern size_t clean_temp_string_hash (const void *x); extern _GL_ASYNC_SAFE int clean_temp_asyncsafe_close (struct closeable_fd *element); extern void clean_temp_init_asyncsafe_close (void); -extern void clean_temp_init (void); +extern int clean_temp_init (void); extern int clean_temp_unlink (const char *absolute_file_name, bool cleanup_verbose); -- cgit v1.2.1