diff mbox

[v2,for-4.7,2/6] tools/xsplice: corrently use errno

Message ID 1462272910-41200-3-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné May 3, 2016, 10:55 a.m. UTC
Some error paths incorrectly used rc instead of errno.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - Fix error message.
---
 tools/misc/xen-xsplice.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Wei Liu May 3, 2016, 11:30 a.m. UTC | #1
On Tue, May 03, 2016 at 12:55:06PM +0200, Roger Pau Monne wrote:
> Some error paths incorrectly used rc instead of errno.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Ross Lagerwall <ross.lagerwall@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> Changes since v1:
>  - Fix error message.
> ---
>  tools/misc/xen-xsplice.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c
> index 0f1ab5a..598e492 100644
> --- a/tools/misc/xen-xsplice.c
> +++ b/tools/misc/xen-xsplice.c
> @@ -272,8 +272,8 @@ int action_func(int argc, char *argv[], unsigned int idx)
>      rc = xc_xsplice_get(xch, name, &status);
>      if ( rc )
>      {
> -        fprintf(stderr, "%s failed to get status (rc=%d, %s)!\n",
> -                name, -rc, strerror(-rc));
> +        fprintf(stderr, "%s failed to get status %d(%s)!\n",
> +                name, errno, strerror(errno));
>          return -1;
>      }
>      if ( status.rc == -EAGAIN )
> @@ -295,7 +295,8 @@ int action_func(int argc, char *argv[], unsigned int idx)
>          rc = action_options[idx].function(xch, name, 0);
>          if ( rc )
>          {
> -            fprintf(stderr, "%s failed with %d(%s)\n", name, -rc, strerror(-rc));
> +            fprintf(stderr, "%s failed with %d(%s)\n", name, errno,
> +                    strerror(errno));
>              return -1;
>          }
>      }
> -- 
> 2.6.4 (Apple Git-63)
>
diff mbox

Patch

diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c
index 0f1ab5a..598e492 100644
--- a/tools/misc/xen-xsplice.c
+++ b/tools/misc/xen-xsplice.c
@@ -272,8 +272,8 @@  int action_func(int argc, char *argv[], unsigned int idx)
     rc = xc_xsplice_get(xch, name, &status);
     if ( rc )
     {
-        fprintf(stderr, "%s failed to get status (rc=%d, %s)!\n",
-                name, -rc, strerror(-rc));
+        fprintf(stderr, "%s failed to get status %d(%s)!\n",
+                name, errno, strerror(errno));
         return -1;
     }
     if ( status.rc == -EAGAIN )
@@ -295,7 +295,8 @@  int action_func(int argc, char *argv[], unsigned int idx)
         rc = action_options[idx].function(xch, name, 0);
         if ( rc )
         {
-            fprintf(stderr, "%s failed with %d(%s)\n", name, -rc, strerror(-rc));
+            fprintf(stderr, "%s failed with %d(%s)\n", name, errno,
+                    strerror(errno));
             return -1;
         }
     }