Changeset 959d2ec in mainline for uspace/app/dnsres/dnsres.c


Ignore:
Timestamp:
2013-05-08T10:29:45Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d242cb6
Parents:
9f029aa
Message:

Return canonical name to caller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/dnsres/dnsres.c

    r9f029aa r959d2ec  
    5050        int rc;
    5151        dnsr_hostinfo_t *hinfo;
     52        char *hname;
    5253        char *saddr;
    5354
     
    5758        }
    5859
    59         rc = dnsr_name2host(argv[1], &hinfo);
     60        hname = argv[1];
     61
     62        rc = dnsr_name2host(hname, &hinfo);
    6063        if (rc != EOK) {
    6164                printf(NAME ": Error resolving '%s'.\n", argv[1]);
     
    7073        }
    7174
    72         printf("Host name: %s address: %s\n", hinfo->name, saddr);
     75        printf("Host name: %s\n", hname);
     76        if (str_cmp(hname, hinfo->cname) != 0)
     77                printf("Canonical name: %s\n", hinfo->cname);
     78        printf("Address: %s\n", saddr);
     79
    7380        dnsr_hostinfo_destroy(hinfo);
    7481        free(saddr);
Note: See TracChangeset for help on using the changeset viewer.