diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-12 18:24:37 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-12 18:24:37 +0000 |
commit | 67f641e75b685abe1588b634b409c1ee2ff68c22 (patch) | |
tree | 74b3e38f1b7caef23bbf06a92b6e5d05530d50a6 /networking/nc.c | |
parent | 2c99851181a652358aa3ca58ef38c57e46ae02e4 (diff) | |
download | busybox-w32-67f641e75b685abe1588b634b409c1ee2ff68c22.tar.gz busybox-w32-67f641e75b685abe1588b634b409c1ee2ff68c22.tar.bz2 busybox-w32-67f641e75b685abe1588b634b409c1ee2ff68c22.zip |
- patch from Denis Vlasenko to add bb_xbind() and bb_xlisten()
Diffstat (limited to 'networking/nc.c')
-rw-r--r-- | networking/nc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/networking/nc.c b/networking/nc.c index 86f0b99df..57b091744 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
@@ -90,16 +90,13 @@ int nc_main(int argc, char **argv) | |||
90 | memset(&address.sin_addr, 0, sizeof(address.sin_addr)); | 90 | memset(&address.sin_addr, 0, sizeof(address.sin_addr)); |
91 | address.sin_port = lport; | 91 | address.sin_port = lport; |
92 | 92 | ||
93 | if (bind(sfd, (struct sockaddr *) &address, sizeof(address)) < 0) | 93 | bb_xbind(sfd, (struct sockaddr *) &address, sizeof(address)); |
94 | bb_perror_msg_and_die("bind"); | ||
95 | } | 94 | } |
96 | 95 | ||
97 | if (do_listen) { | 96 | if (do_listen) { |
98 | socklen_t addrlen = sizeof(address); | 97 | socklen_t addrlen = sizeof(address); |
99 | 98 | ||
100 | if (listen(sfd, 1) < 0) | 99 | bb_xlisten(sfd, 1); |
101 | bb_perror_msg_and_die("listen"); | ||
102 | |||
103 | if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &addrlen)) < 0) | 100 | if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &addrlen)) < 0) |
104 | bb_perror_msg_and_die("accept"); | 101 | bb_perror_msg_and_die("accept"); |
105 | 102 | ||