#include <string.h>
#include <sys/stat.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
+
#ifdef HAVE_LIBMAGIC
#include <magic.h>
#endif
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_LIBMAGIC)
+#if defined(HAVE_LIBMAGIC)
static pcre *re_file_elf;
static pcre *re_elf_ppc64;
error (g, "file_architecture: could not determine architecture of cpio archive");
out:
- /* Free up the temporary directory. Note the directory name cannot
- * contain shell meta-characters because of the way it was
- * constructed above.
- */
- snprintf (cmd, cmd_len, "rm -rf %s", dir);
- ignore_value (system (cmd));
+ guestfs___remove_tmpdir (dir);
return ret;
#undef dir_len
return ret; /* caller frees */
}
-#else /* no PCRE or libmagic at compile time */
+#else /* no libmagic at compile time */
/* XXX Should be an optgroup. */
#define NOT_IMPL(r) \
- error (g, _("file-architecture API not available since this version of libguestfs was compiled without PCRE or libmagic libraries")); \
+ error (g, _("file-architecture API not available since this version of libguestfs was compiled without the libmagic library")); \
return r
char *
NOT_IMPL(NULL);
}
-#endif /* no PCRE or libmagic at compile time */
+#endif /* no libmagic at compile time */