[file-roller/wip/jtojnar/cleanups: 1/2] Remove custom mkdtemp fallback
- From: Jan Tojnar <jtojnar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller/wip/jtojnar/cleanups: 1/2] Remove custom mkdtemp fallback
- Date: Mon, 20 Jun 2022 22:14:20 +0000 (UTC)
commit 0b1165350e8005af96449fca6ce06cd67a21fd4e
Author: Jan Tojnar <jtojnar gmail com>
Date: Mon Jun 20 23:54:46 2022 +0200
Remove custom mkdtemp fallback
GLib contained one for over ten years (since 2.30):
https://gitlab.gnome.org/GNOME/glib/-/commit/b76bb6713ba12a88fbccdaaf063d916ecd3af0b2
meson.build | 6 --
po/POTFILES.in | 2 -
src/file-utils.c | 6 +-
src/fr-command-tar.c | 2 +-
src/meson.build | 3 -
src/mkdtemp.c | 200 ---------------------------------------------------
src/mkdtemp.h | 39 ----------
7 files changed, 2 insertions(+), 256 deletions(-)
---
diff --git a/meson.build b/meson.build
index 6d63b6c3..7294cd6f 100644
--- a/meson.build
+++ b/meson.build
@@ -46,8 +46,6 @@ use_json_glib = libjson_glib_dep.found()
libarchive_dep = dependency('libarchive', version : libarchive_version, required : get_option('libarchive'))
use_libarchive = libarchive_dep.found()
-have_mkdtemp = c_comp.has_function('mkdtemp')
-
cpio_path = 'cpio'
if get_option('cpio') == 'auto'
cpio = find_program('gcpio', 'cpio', required : false)
@@ -103,9 +101,6 @@ endif
if get_option('buildtype').contains('debug')
config_data.set('DEBUG', 1)
endif
-if have_mkdtemp
- config_data.set('HAVE_MKDTEMP', 1)
-endif
config_data.set_quoted('CPIO_PATH', cpio_path)
config_data.set('USE_NATIVE_APPCHOOSER', use_native_appchooser)
config_file = configure_file(output : 'config.h', configuration : config_data)
@@ -161,7 +156,6 @@ summary = [
' nautilus actions: @0@'.format(build_nautilus_actions),
' packagekit: @0@'.format(get_option('packagekit')),
' libarchive: @0@'.format(use_libarchive),
- ' have mkdtemp: @0@'.format(have_mkdtemp),
' cpio: @0@'.format(cpio_path),
''
]
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e99a08fc..bb626f3f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -116,8 +116,6 @@ src/gtk-utils.h
src/java-utils.c
src/java-utils.h
src/main.c
-src/mkdtemp.c
-src/mkdtemp.h
src/open-file.c
src/open-file.h
src/preferences.c
diff --git a/src/file-utils.c b/src/file-utils.c
index bddf894e..2095a8d2 100644
--- a/src/file-utils.c
+++ b/src/file-utils.c
@@ -39,10 +39,6 @@
#include "fr-init.h"
-#ifndef HAVE_MKDTEMP
-#include "mkdtemp.h"
-#endif
-
#define BUF_SIZE 4096
#define FILE_PREFIX "file://"
#define FILE_PREFIX_L 7
@@ -108,7 +104,7 @@ _g_path_get_temp_work_dir (const char *parent_folder)
return NULL;
template = g_strconcat (best_folder, "/.fr-XXXXXX", NULL);
- result = mkdtemp (template);
+ result = g_mkdtemp (template);
g_free (best_folder);
if ((result == NULL) || (*result == '\0')) {
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index 889c4fa0..3c620772 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -962,7 +962,7 @@ get_temp_name (FrCommandTar *c_tar,
char *temp_name = NULL;
template = g_strconcat (dirname, "/.fr-XXXXXX", NULL);
- result = mkdtemp (template);
+ result = g_mkdtemp (template);
temp_name = g_build_filename (result, _g_path_get_basename (filepath), NULL);
g_free (template);
diff --git a/src/meson.build b/src/meson.build
index ac6e2b3e..02031928 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -101,9 +101,6 @@ if use_libarchive
source_files += [ 'fr-archive-libarchive.c' ]
fr_headers += [ 'fr-archive-libarchive.h' ]
endif
-if not have_mkdtemp
- source_files += [ 'mkdtemp.c' ]
-endif
gresource_files = gnome.compile_resources('fr-resources', 'file-roller.gresource.xml', c_name : 'fr')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]