do {
if (is_udp(o)) {
- struct sockaddr *to;
+ const struct sockaddr *to;
socklen_t len;
if (is_ipv6(o)) {
}
if (bind(fd, saddr, len) < 0) {
+ close(fd);
td_verror(td, errno, "bind");
return 1;
}
struct netio_data *nd;
if (!td->files_index) {
- add_file(td, td->o.filename ?: "net", 0);
+ add_file(td, td->o.filename ?: "net", 0, 0);
td->o.nr_files = td->o.nr_files ?: 1;
+ td->o.open_files++;
}
if (!td->io_ops->data) {