hivex: Add HIVEX_OPEN_WRITE flag to allow hive to be opened for writing.
[libguestfs.git] / hivex / hivexsh.c
index d7d00bb..01a5ddc 100644 (file)
@@ -146,7 +146,8 @@ main (int argc, char *argv[])
     char *buf = rl_gets (prompt_string);
     if (!buf) {
       quit = 1;
-      printf ("\n");
+      if (is_tty)
+        printf ("\n");
       break;
     }
 
@@ -219,7 +220,7 @@ set_prompt_string (void)
   fp = open_memstream (&ptr, &size);
   if (fp == NULL) {
     perror ("open_memstream");
-    exit (1);
+    exit (EXIT_FAILURE);
   }
 
   if (h) {
@@ -569,7 +570,7 @@ cmd_ls (char *args)
   char **names = calloc (len, sizeof (char *));
   if (names == NULL) {
     perror ("malloc");
-    exit (1);
+    exit (EXIT_FAILURE);
   }
 
   int ret = -1;