mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00: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 "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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user