- patch from Denis Vlasenko to add bb_xbind() and bb_xlisten()

This commit is contained in:
Bernhard Reutner-Fischer
2006-04-12 18:24:37 +00:00
parent 2c99851181
commit 67f641e75b
10 changed files with 50 additions and 28 deletions

View File

@@ -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");