mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
fdstream: Report error with virProcessTranslateStatus
Rather than poorly duplicate it
This commit is contained in:
parent
c0e870376c
commit
6b173cf562
@ -43,6 +43,7 @@
|
|||||||
#include "configmake.h"
|
#include "configmake.h"
|
||||||
#include "virstring.h"
|
#include "virstring.h"
|
||||||
#include "virtime.h"
|
#include "virtime.h"
|
||||||
|
#include "virprocess.h"
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_STREAMS
|
#define VIR_FROM_THIS VIR_FROM_STREAMS
|
||||||
|
|
||||||
@ -263,13 +264,12 @@ virFDStreamCloseCommand(struct virFDStreamData *fdst)
|
|||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
if (buf[0] != '\0') {
|
if (buf[0] != '\0') {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", buf);
|
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 {
|
} else {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
char *str = virProcessTranslateStatus(status);
|
||||||
_("I/O helper exited abnormally"));
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("I/O helper exited with %s"),
|
||||||
|
NULLSTR(str));
|
||||||
|
VIR_FREE(str);
|
||||||
}
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user