X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Ffilearch.c;h=1802ec4750f30d7290aceaf60f6e48579ae9cfd2;hp=14c7c02741edf66c74eb3894263726ec184b6ebf;hb=690ff694ca6db586c06ec484ea158261c156aa2f;hpb=b943d06466724df39b7261ce75e43b0201ed7372 diff --git a/src/filearch.c b/src/filearch.c index 14c7c02..1802ec4 100644 --- a/src/filearch.c +++ b/src/filearch.c @@ -26,9 +26,8 @@ #include #include -#ifdef HAVE_PCRE #include -#endif + #ifdef HAVE_LIBMAGIC #include #endif @@ -40,7 +39,7 @@ #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; @@ -214,12 +213,7 @@ cpio_arch (guestfs_h *g, const char *file, const char *path) 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 @@ -258,12 +252,12 @@ guestfs__file_architecture (guestfs_h *g, const char *path) 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 * @@ -272,4 +266,4 @@ guestfs__file_architecture (guestfs_h *g, const char *path) NOT_IMPL(NULL); } -#endif /* no PCRE or libmagic at compile time */ +#endif /* no libmagic at compile time */