From 6b173cf562aa9997416bdbe3b573eabb921ee71f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 25 Apr 2016 12:34:14 -0400 Subject: [PATCH] fdstream: Report error with virProcessTranslateStatus Rather than poorly duplicate it --- src/fdstream.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fdstream.c b/src/fdstream.c index 69d17b42f0..8e5fa2fd0e 100644 --- a/src/fdstream.c +++ b/src/fdstream.c @@ -43,6 +43,7 @@ #include "configmake.h" #include "virstring.h" #include "virtime.h" +#include "virprocess.h" #define VIR_FROM_THIS VIR_FROM_STREAMS @@ -263,13 +264,12 @@ virFDStreamCloseCommand(struct virFDStreamData *fdst) if (status != 0) { if (buf[0] != '\0') { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", buf); - } else if (WIFEXITED(status)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("I/O helper exited with status %d"), - WEXITSTATUS(status)); } else { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("I/O helper exited abnormally")); + char *str = virProcessTranslateStatus(status); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("I/O helper exited with %s"), + NULLSTR(str)); + VIR_FREE(str); } goto cleanup; }