diff options
Diffstat (limited to 'nc.c')
-rw-r--r-- | nc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -69,7 +69,7 @@ int nc_main(int argc, char **argv) | |||
69 | hostinfo = (struct hostent *) gethostbyname(*argv); | 69 | hostinfo = (struct hostent *) gethostbyname(*argv); |
70 | 70 | ||
71 | if (!hostinfo) { | 71 | if (!hostinfo) { |
72 | exit(1); | 72 | fatalError("nc: cannot resolve %s\n", *argv); |
73 | } | 73 | } |
74 | 74 | ||
75 | address.sin_family = AF_INET; | 75 | address.sin_family = AF_INET; |
@@ -81,6 +81,7 @@ int nc_main(int argc, char **argv) | |||
81 | result = connect(sfd, (struct sockaddr *) &address, len); | 81 | result = connect(sfd, (struct sockaddr *) &address, len); |
82 | 82 | ||
83 | if (result < 0) { | 83 | if (result < 0) { |
84 | perror("nc: connect"); | ||
84 | exit(2); | 85 | exit(2); |
85 | } | 86 | } |
86 | 87 | ||
@@ -100,6 +101,7 @@ int nc_main(int argc, char **argv) | |||
100 | (struct timeval *) 0); | 101 | (struct timeval *) 0); |
101 | 102 | ||
102 | if (result < 1) { | 103 | if (result < 1) { |
104 | perror("nc: select"); | ||
103 | exit(3); | 105 | exit(3); |
104 | } | 106 | } |
105 | 107 | ||