Displaying 2 results from an estimated 2 matches for "f92bda1".
Did you mean:
622bda1
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...on_index);
- exit (EXIT_FAILURE);
- }
+ } else
+ error (EXIT_FAILURE, 0,
+ _("unknown long option: %s (%d)"),
+ long_options[option_index].name, option_index);
break;
case 'a':
diff --git a/cat/ls.c b/cat/ls.c
index f92bda1..91f2125 100644
--- a/cat/ls.c
+++ b/cat/ls.c
@@ -178,10 +178,8 @@ main (int argc, char *argv[])
int mode = 0;
g = guestfs_create ();
- if (g == NULL) {
- fprintf (stderr, _("guestfs_create: failed to create handle\n"));
- exit (EXIT_FAILURE);
- }
+ if (g == NULL)
+ er...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...loc (rows, sizeof (char **) * (nr_rows + 1));
- if (rows == NULL) {
- perror ("realloc");
- exit (EXIT_FAILURE);
- }
+ if (rows == NULL)
+ error (EXIT_FAILURE, errno, "realloc");
rows[nr_rows] = row;
nr_rows++;
}
diff --git a/cat/ls.c b/cat/ls.c
index c49d1ce..f92bda1 100644
--- a/cat/ls.c
+++ b/cat/ls.c
@@ -26,6 +26,7 @@
#include <getopt.h>
#include <fcntl.h>
#include <errno.h>
+#include <error.h>
#include <locale.h>
#include <assert.h>
#include <time.h>
@@ -291,24 +292,18 @@ main (int argc, char *argv[])
i...