misc/create_inode_libarchive.c uses uselocale(), newlocale(), et. al.
These functions are defined in POSIX.1-2017, which isn't available
everywhere --- including MacOS and Windows.
We don't actually need to use these functions, since mke2fs already
calls setlocale() to initialize to use the default locale. So there
was no reason to set and restore the locale to use exactly the default
locale.
Fixes:
ecfd4dd1217a ("Decouple --without-libarchive and HAVE_ARCHIVE_H")
Fixes:
7e3a4f0a33e9 ("mke2fs: the -d option can now handle tarball input")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
#include <string.h>
#include <time.h>
#include <libgen.h>
+#include <locale.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
char *jbd_debug;
#endif
+ setlocale(LC_CTYPE, "");
+
if (debug_prog_name == 0)
#ifdef READ_ONLY
debug_prog_name = "rdebugfs";
#endif /* HAVE_ARCHIVE_H */
#include <libgen.h>
-#include <locale.h>
static const char *(*dl_archive_entry_hardlink)(struct archive_entry *);
static const char *(*dl_archive_entry_pathname)(struct archive_entry *);
struct archive *a;
struct archive_entry *entry;
errcode_t retval = 0;
- locale_t archive_locale;
- locale_t old_locale;
ext2_ino_t dirinode, tmpino;
const struct stat *st;
return 1;
}
- archive_locale = newlocale(LC_CTYPE_MASK, "", (locale_t)0);
- old_locale = uselocale(archive_locale);
a = dl_archive_read_new();
if (a == NULL) {
retval = 1;
out:
dl_archive_read_close(a);
dl_archive_read_free(a);
- uselocale(old_locale);
- freelocale(archive_locale);
return retval;
}