diff options
author | Thomas Graf <tgr@lsx.localdomain> | 2008-05-22 22:02:02 (GMT) |
---|---|---|
committer | Thomas Graf <tgr@lsx.localdomain> | 2008-05-22 22:02:02 (GMT) |
commit | 10cf5a586c149fdb7e2639000dbfae5e6f8522a5 (patch) | |
tree | 399a15d767fd15b85c92be2e70b748645eeb983e /src/nl-util-addr.c | |
parent | 337fbd24cad1f5cf9c8b4287a75f2c69f088adce (diff) | |
download | libnl-10cf5a586c149fdb7e2639000dbfae5e6f8522a5.zip libnl-10cf5a586c149fdb7e2639000dbfae5e6f8522a5.tar.gz libnl-10cf5a586c149fdb7e2639000dbfae5e6f8522a5.tar.bz2 |
New set of libnl tools
Converts all tools to the API changes and improves the useability by
introducing regular options and long options.
Diffstat (limited to 'src/nl-util-addr.c')
-rw-r--r-- | src/nl-util-addr.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/nl-util-addr.c b/src/nl-util-addr.c index 9f12795..93779ea 100644 --- a/src/nl-util-addr.c +++ b/src/nl-util-addr.c @@ -6,7 +6,7 @@ * License as published by the Free Software Foundation version 2.1 * of the License. * - * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch> + * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> */ #include "utils.h" @@ -21,19 +21,12 @@ int main(int argc, char *argv[]) fprintf(stderr, "Usage: nl-util-addr <address>\n"); return -1; } - - a = nl_addr_parse(argv[1], AF_UNSPEC); - if (a == NULL) { - fprintf(stderr, "Cannot parse address \"%s\"\n", argv[1]); - return -1; - } + a = nlt_addr_parse(argv[1], AF_UNSPEC); err = nl_addr_resolve(a, host, sizeof(host)); - if (err != 0) { - fprintf(stderr, "Cannot resolve address \"%s\": %d\n", - argv[1], err); - return -1; - } + if (err != 0) + fatal(err, "Unable to resolve address \"%s\": %s", + argv[1], nl_geterror(err)); printf("%s\n", host); |