Changes in uspace/app/nterm/conn.c [fff7ef4:3e6a98c5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nterm/conn.c
rfff7ef4 r3e6a98c5 33 33 */ 34 34 35 #include <byteorder.h>36 35 #include <stdbool.h> 37 36 #include <errno.h> 38 37 #include <fibril.h> 39 #include <inet/dnsr.h>40 38 #include <net/socket.h> 41 39 #include <stdio.h> … … 76 74 { 77 75 struct sockaddr_in addr; 78 dnsr_hostinfo_t *hinfo = NULL;79 76 int rc; 80 77 char *endptr; … … 84 81 rc = inet_pton(addr.sin_family, addr_s, (uint8_t *)&addr.sin_addr); 85 82 if (rc != EOK) { 86 /* Try interpreting as a host name */ 87 rc = dnsr_name2host(addr_s, &hinfo); 88 if (rc != EOK) { 89 printf("Error resolving host '%s'.\n", addr_s); 90 goto error; 91 } 92 93 addr.sin_addr.s_addr = host2uint32_t_be(hinfo->addr.ipv4); 83 printf("Invalid addres %s\n", addr_s); 84 return EINVAL; 94 85 } 95 86 … … 97 88 if (*endptr != '\0') { 98 89 printf("Invalid port number %s\n", port_s); 99 goto error;90 return EINVAL; 100 91 } 101 92 … … 104 95 goto error; 105 96 106 printf("Connecting to host%s port %u\n", addr_s, ntohs(addr.sin_port));97 printf("Connecting to address %s port %u\n", addr_s, ntohs(addr.sin_port)); 107 98 108 99 rc = connect(conn_fd, (struct sockaddr *)&addr, sizeof(addr));
Note:
See TracChangeset
for help on using the changeset viewer.