diff options
author | Brad Hubbard <bhubbard@redhat.com> | 2015-08-19 18:56:06 +1000 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2015-09-01 00:01:04 -0700 |
commit | 4b5aec8da9be69da077e1fcc7e852d224517ecc0 (patch) | |
tree | 522c537f0f1879175f0698377290c33e9add7542 /xlators | |
parent | 4c6d1c0dc7e5f51c7f3d477fb274517d57289276 (diff) |
glusterd: Return better error messages for probe and detach failures
We handle some specific errors and return good error messages for those, but for
the default case where the error code is not recognised we just report "unknown
errno". This patch attempts to at least return the output of strerror to provide
more informative errors.
BUG: 1257149
Change-Id: I0027e74e41adac4ab0c0a929c6fff56878bf39c8
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
Reviewed-on: http://review.gluster.org/12021
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 911bab9b4bc..3494585e7e9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -3799,8 +3799,8 @@ set_probe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr, default: if (op_errno != 0) snprintf (errstr, len, "Probe returned " - "with unknown errno %d", - op_errno); + "with %s", + strerror (op_errno)); break; } } else { @@ -3854,7 +3854,7 @@ set_probe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr, default: snprintf (errstr, len, "Probe returned with " - "unknown errno %d", op_errno); + "%s", strerror (op_errno)); break; } } @@ -3950,7 +3950,7 @@ set_deprobe_error_str (int op_ret, int op_errno, char *op_errstr, char *errstr, break; default: snprintf (errstr, len, "Detach returned with " - "unknown errno %d", op_errno); + "%s", strerror (op_errno)); break; } |