Reformat some socket functions.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@463 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-14 13:50:55 +00:00
parent 4174577db3
commit 639e924ef5

View File

@@ -162,13 +162,13 @@ int ssh_socket_unix(struct socket *s, const char *path) {
* \brief closes a socket
*/
void ssh_socket_close(struct socket *s){
if(ssh_socket_is_open(s)){
if (ssh_socket_is_open(s)) {
#ifdef _WIN32
closesocket(s->fd);
s->last_errno=WSAGetLastError();
s->last_errno = WSAGetLastError();
#else
close(s->fd);
s->last_errno=errno;
s->last_errno = errno;
#endif
s->fd=-1;
}
@@ -177,21 +177,21 @@ void ssh_socket_close(struct socket *s){
/* \internal
* \brief sets the file descriptor of the socket
*/
void ssh_socket_set_fd(struct socket *s, socket_t fd){
s->fd=fd;
void ssh_socket_set_fd(struct socket *s, socket_t fd) {
s->fd = fd;
}
/* \internal
* \brief returns the file descriptor of the socket
*/
socket_t ssh_socket_get_fd(struct socket *s){
socket_t ssh_socket_get_fd(struct socket *s) {
return s->fd;
}
/* \internal
* \brief returns nonzero if the socket is open
*/
int ssh_socket_is_open(struct socket *s){
int ssh_socket_is_open(struct socket *s) {
return s->fd != -1;
}