X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=hivex%2Fhivexget.c;h=8cc395a1fca11c7725a884741459fd332df692e1;hp=9bb6bbb1bbeb319a59d929702e652b7e9f7484e4;hb=c372c7c23a298a940b8a0868396ef2ae0d824e4d;hpb=792c5283009ed6753239a14df9a6e9c71bea35fd diff --git a/hivex/hivexget.c b/hivex/hivexget.c index 9bb6bbb..8cc395a 100644 --- a/hivex/hivexget.c +++ b/hivex/hivexget.c @@ -16,6 +16,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include + #include #include #include @@ -30,7 +32,7 @@ main (int argc, char *argv[]) { if (argc < 3 || argc > 4) { fprintf (stderr, "hivexget regfile path [key]\n"); - exit (1); + exit (EXIT_FAILURE); } char *file = argv[1]; char *path = argv[2]; @@ -38,19 +40,19 @@ main (int argc, char *argv[]) if (path[0] != '\\') { fprintf (stderr, "hivexget: path must start with a \\ character\n"); - exit (1); + exit (EXIT_FAILURE); } if (path[1] == '\\') { doubled: fprintf (stderr, "hivexget: %s: \\ characters in path are doubled - are you escaping the path parameter correctly?\n", path); - exit (1); + exit (EXIT_FAILURE); } hive_h *h = hivex_open (file, 0); if (h == NULL) { error: perror (file); - exit (1); + exit (EXIT_FAILURE); } /* Navigate to the desired node. */ @@ -262,5 +264,5 @@ main (int argc, char *argv[]) if (hivex_close (h) == -1) goto error; - exit (0); + exit (EXIT_SUCCESS); }