mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
use errno, not socket_errno()
* remote_internal.c: s/socket_errno()/errno/, now that gnulib's socket module ensures errno is useful in those cases.
This commit is contained in:
parent
b80b3ce4b3
commit
c5f45efd06
@ -1,3 +1,9 @@
|
|||||||
|
Tue Oct 28 13:29:05 +0100 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
use errno, not socket_errno()
|
||||||
|
* remote_internal.c: s/socket_errno()/errno/, now that gnulib's
|
||||||
|
socket module ensures errno is useful in those cases.
|
||||||
|
|
||||||
Tue Oct 28 12:12:41 +0100 2008 Jim Meyering <meyering@redhat.com>
|
Tue Oct 28 12:12:41 +0100 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
socketcompat.h: simplify, to match latest gnulib
|
socketcompat.h: simplify, to match latest gnulib
|
||||||
|
@ -482,7 +482,7 @@ doRemoteOpen (virConnectPtr conn,
|
|||||||
|
|
||||||
priv->sock = socket (r->ai_family, SOCK_STREAM, 0);
|
priv->sock = socket (r->ai_family, SOCK_STREAM, 0);
|
||||||
if (priv->sock == -1) {
|
if (priv->sock == -1) {
|
||||||
saved_errno = socket_errno();
|
saved_errno = errno;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +492,7 @@ doRemoteOpen (virConnectPtr conn,
|
|||||||
sizeof no_slow_start);
|
sizeof no_slow_start);
|
||||||
|
|
||||||
if (connect (priv->sock, r->ai_addr, r->ai_addrlen) == -1) {
|
if (connect (priv->sock, r->ai_addr, r->ai_addrlen) == -1) {
|
||||||
saved_errno = socket_errno();
|
saved_errno = errno;
|
||||||
close (priv->sock);
|
close (priv->sock);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -3980,7 +3980,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
|
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
|
||||||
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
||||||
_("failed to get sock address %d (%s)"),
|
_("failed to get sock address %d (%s)"),
|
||||||
socket_errno (), strerror(socket_errno ()));
|
errno, strerror(errno));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if ((localAddr = addrToString(&sa, salen)) == NULL)
|
if ((localAddr = addrToString(&sa, salen)) == NULL)
|
||||||
@ -3992,7 +3992,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
|
|||||||
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
|
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
|
||||||
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
||||||
_("failed to get peer address %d (%s)"),
|
_("failed to get peer address %d (%s)"),
|
||||||
socket_errno (), strerror(socket_errno ()));
|
errno, strerror(errno));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if ((remoteAddr = addrToString(&sa, salen)) == NULL)
|
if ((remoteAddr = addrToString(&sa, salen)) == NULL)
|
||||||
@ -4627,11 +4627,10 @@ really_write_buf (virConnectPtr conn, struct private_data *priv,
|
|||||||
do {
|
do {
|
||||||
err = send (priv->sock, p, len, 0);
|
err = send (priv->sock, p, len, 0);
|
||||||
if (err == -1) {
|
if (err == -1) {
|
||||||
int errno_ = socket_errno ();
|
if (errno == EINTR || errno == EAGAIN)
|
||||||
if (errno_ == EINTR || errno_ == EAGAIN)
|
|
||||||
continue;
|
continue;
|
||||||
error (in_open ? NULL : conn,
|
error (in_open ? NULL : conn,
|
||||||
VIR_ERR_SYSTEM_ERROR, strerror (errno_));
|
VIR_ERR_SYSTEM_ERROR, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
len -= err;
|
len -= err;
|
||||||
@ -4710,11 +4709,10 @@ really_read_buf (virConnectPtr conn, struct private_data *priv,
|
|||||||
reread:
|
reread:
|
||||||
err = recv (priv->sock, bytes, len, 0);
|
err = recv (priv->sock, bytes, len, 0);
|
||||||
if (err == -1) {
|
if (err == -1) {
|
||||||
int errno_ = socket_errno ();
|
if (errno == EINTR)
|
||||||
if (errno_ == EINTR)
|
|
||||||
goto reread;
|
goto reread;
|
||||||
error (in_open ? NULL : conn,
|
error (in_open ? NULL : conn,
|
||||||
VIR_ERR_SYSTEM_ERROR, strerror (errno_));
|
VIR_ERR_SYSTEM_ERROR, strerror (errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user