} while (ret == -1 && errno == EINTR);
if (ret == -1) {
- perror("close()");
+ log_perror("close()");
}
}
} while (err == -1 && errno == EINTR);
if (err == -1) {
- perror("close");
+ log_perror("close");
// Can still continue.
}
continue;
}
if (nfds == -1) {
- perror("poll");
+ log_perror("poll");
state = CLOSING_SOCKET;
}
}
// Yay, successful connect. Try to set it as nonblocking.
int one = 1;
if (ioctl(sock, FIONBIO, &one) == -1) {
- perror("ioctl(FIONBIO)");
+ log_perror("ioctl(FIONBIO)");
state = CLOSING_SOCKET;
} else {
state = SENDING_REQUEST;
} while (ret == -1 && errno == EINTR);
if (ret == -1) {
- perror("write");
+ log_perror("write");
state = CLOSING_SOCKET;
continue;
}
} while (ret == -1 && errno == EINTR);
if (ret == -1) {
- perror("read");
+ log_perror("read");
state = CLOSING_SOCKET;
continue;
}
} while (ret == -1 && errno == EINTR);
if (ret == -1) {
- perror("read");
+ log_perror("read");
state = CLOSING_SOCKET;
continue;
}
} while (err == -1 && errno == EINTR);
if (err == -1) {
- perror("close");
+ log_perror("close");
}
state = NOT_CONNECTED;