[libvirt] [PATCH 09/17] use errno, not socket_errno()

Daniel P. Berrange berrange at redhat.com
Tue Oct 28 11:36:26 UTC 2008


On Tue, Oct 28, 2008 at 12:21:26PM +0100, Jim Meyering wrote:
> From: Jim Meyering <meyering at redhat.com>
> 
> * remote_internal.c: s/socket_errno()/errno/, now that gnulib's
> socket module ensures errno is useful in those cases.
> @@ -4627,7 +4627,7 @@ really_write_buf (virConnectPtr conn, struct private_data *priv,
>          do {
>              err = send (priv->sock, p, len, 0);
>              if (err == -1) {
> -                int errno_ = socket_errno ();
> +                int errno_ = errno;
>                  if (errno_ == EINTR || errno_ == EAGAIN)
>                      continue;
>                  error (in_open ? NULL : conn,
> @@ -4710,7 +4710,7 @@ really_read_buf (virConnectPtr conn, struct private_data *priv,
>      reread:
>          err = recv (priv->sock, bytes, len, 0);
>          if (err == -1) {
> -            int errno_ = socket_errno ();
> +            int errno_ = errno;
>              if (errno_ == EINTR)
>                  goto reread;
>              error (in_open ? NULL : conn,

Do we need to keep this intermediate variable around ? I think we can
just of 'if (errno == EINTR)' directly ?

ACK anyway

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list