X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=hivex%2Fhivexml.c;h=7fb419f9735a475bc1a681848caf2ade114fdec1;hb=500ab86509e819cdf9c379f0bf6f0076bdd2ab68;hp=af3de9e4746df666bdac9a1edc23440bf2021254;hpb=792c5283009ed6753239a14df9a6e9c71bea35fd;p=libguestfs.git diff --git a/hivex/hivexml.c b/hivex/hivexml.c index af3de9e..7fb419f 100644 --- a/hivex/hivexml.c +++ b/hivex/hivexml.c @@ -16,6 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include + #include #include #include @@ -57,7 +59,7 @@ static struct hivex_visitor visitor = { do { \ if ((proc args) == -1) { \ fprintf (stderr, "%s: failed to write XML document\n", #proc); \ - exit (1); \ + exit (EXIT_FAILURE); \ } \ } while (0) @@ -78,19 +80,19 @@ main (int argc, char *argv[]) break; default: fprintf (stderr, "hivexml [-dk] regfile > output.xml\n"); - exit (1); + exit (EXIT_FAILURE); } } if (optind + 1 != argc) { fprintf (stderr, "hivexml: missing name of input file\n"); - exit (1); + exit (EXIT_FAILURE); } hive_h *h = hivex_open (argv[optind], open_flags); if (h == NULL) { perror (argv[optind]); - exit (1); + exit (EXIT_FAILURE); } /* Note both this macro, and xmlTextWriterStartDocument leak memory. There @@ -103,7 +105,7 @@ main (int argc, char *argv[]) writer = xmlNewTextWriterFilename ("/dev/stdout", 0); if (writer == NULL) { fprintf (stderr, "xmlNewTextWriterFilename: failed to create XML writer\n"); - exit (1); + exit (EXIT_FAILURE); } XML_CHECK (xmlTextWriterStartDocument, (writer, NULL, "utf-8", NULL)); @@ -111,19 +113,19 @@ main (int argc, char *argv[]) if (hivex_visit (h, &visitor, sizeof visitor, writer, visit_flags) == -1) { perror (argv[optind]); - exit (1); + exit (EXIT_FAILURE); } if (hivex_close (h) == -1) { perror (argv[optind]); - exit (1); + exit (EXIT_FAILURE); } XML_CHECK (xmlTextWriterEndElement, (writer)); XML_CHECK (xmlTextWriterEndDocument, (writer)); xmlFreeTextWriter (writer); - exit (0); + exit (EXIT_SUCCESS); } static int