summaryrefslogtreecommitdiffstats
path: root/text-utils/hexdump.c
diff options
context:
space:
mode:
authorSami Kerola2011-02-12 21:55:53 +0100
committerKarel Zak2011-02-21 14:38:23 +0100
commit85bf44b714ab184907eb448eba389218956d6a51 (patch)
treebe829d3b7f32bcc4583712b923d59998e87da8f8 /text-utils/hexdump.c
parentipcs: really show all resources when -a and -i are combined (diff)
downloadkernel-qcow2-util-linux-85bf44b714ab184907eb448eba389218956d6a51.tar.gz
kernel-qcow2-util-linux-85bf44b714ab184907eb448eba389218956d6a51.tar.xz
kernel-qcow2-util-linux-85bf44b714ab184907eb448eba389218956d6a51.zip
hexdump: new usage(), xalloc and err.h stuff
New usage help screen and print version switch. Also fixes to exit codes, util linux xmalloc replaced emalloc and every error print is using libc error function. [kzak@redhat.com: - minor changes in formatting and coding style] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/hexdump.c')
-rw-r--r--text-utils/hexdump.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c
index 6132bf115..fd4b37d47 100644
--- a/text-utils/hexdump.c
+++ b/text-utils/hexdump.c
@@ -38,6 +38,8 @@
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
+#include <err.h>
+#include <stdlib.h>
#include "hexdump.h"
#include "nls.h"
@@ -57,11 +59,9 @@ int main(int argc, char **argv)
if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) {
newsyntax(argc, &argv);
- } else {
- fprintf(stderr,
- _("Calling hexdump as od has been deprecated in favour to GNU coreutils od.\n"));
- return(1);
- }
+ } else
+ errx(EXIT_FAILURE, _("calling hexdump as od has been deprecated "
+ "in favour to GNU coreutils od."));
/* figure out the data block size */
for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {