summaryrefslogtreecommitdiff
path: root/networking/nc.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-04-12 18:24:37 +0000
committerBernhard Reutner-Fischer2006-04-12 18:24:37 +0000
commit67f641e75b685abe1588b634b409c1ee2ff68c22 (patch)
tree74b3e38f1b7caef23bbf06a92b6e5d05530d50a6 /networking/nc.c
parent2c99851181a652358aa3ca58ef38c57e46ae02e4 (diff)
downloadbusybox-67f641e75b685abe1588b634b409c1ee2ff68c22.zip
busybox-67f641e75b685abe1588b634b409c1ee2ff68c22.tar.gz
- patch from Denis Vlasenko to add bb_xbind() and bb_xlisten()
Diffstat (limited to 'networking/nc.c')
-rw-r--r--networking/nc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/networking/nc.c b/networking/nc.c
index 86f0b99..57b0917 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -90,16 +90,13 @@ int nc_main(int argc, char **argv)
memset(&address.sin_addr, 0, sizeof(address.sin_addr));
address.sin_port = lport;
- if (bind(sfd, (struct sockaddr *) &address, sizeof(address)) < 0)
- bb_perror_msg_and_die("bind");
+ bb_xbind(sfd, (struct sockaddr *) &address, sizeof(address));
}
if (do_listen) {
socklen_t addrlen = sizeof(address);
- if (listen(sfd, 1) < 0)
- bb_perror_msg_and_die("listen");
-
+ bb_xlisten(sfd, 1);
if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &addrlen)) < 0)
bb_perror_msg_and_die("accept");