ReportError: mark for translation string args to this function

* Makefile.maint (msg_gen_function): Add ReportError.
* src/util.c (_virExec): Mark strings.
This commit is contained in:
Jim Meyering 2008-03-27 13:47:00 +00:00
parent 56a3cb8086
commit 3163224bb5
3 changed files with 16 additions and 11 deletions

View File

@ -1,5 +1,9 @@
Thu Mar 27 14:36:56 CET 2008 Jim Meyering <meyering@redhat.com> Thu Mar 27 14:36:56 CET 2008 Jim Meyering <meyering@redhat.com>
ReportError: mark for translation string args to this function
* Makefile.maint (msg_gen_function): Add ReportError.
* src/util.c (_virExec): Mark strings.
xenXMError: mark for translation string args to this function xenXMError: mark for translation string args to this function
* Makefile.maint (msg_gen_function): Add xenXMError. * Makefile.maint (msg_gen_function): Add xenXMError.
* src/xm_internal.c (xenXMParseXMLToConfig, xenXMDomainDefineXML): * src/xm_internal.c (xenXMParseXMLToConfig, xenXMDomainDefineXML):

View File

@ -313,9 +313,9 @@ msg_gen_function += qemudLog
msg_gen_function += remoteDispatchError msg_gen_function += remoteDispatchError
msg_gen_function += virStorageLog msg_gen_function += virStorageLog
msg_gen_function += xenXMError msg_gen_function += xenXMError
msg_gen_function += ReportError
# msg_gen_function += virXenError # msg_gen_function += virXenError
# msg_gen_function += ReportError
# msg_gen_function += testError # msg_gen_function += testError
# msg_gen_function += openvzLog # msg_gen_function += openvzLog
# msg_gen_function += qemudReportError # msg_gen_function += qemudReportError

View File

@ -106,21 +106,22 @@ _virExec(virConnectPtr conn,
int pipeerr[2] = {-1,-1}; int pipeerr[2] = {-1,-1};
if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) { if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) {
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot open %s : %s", ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
_("cannot open %s: %s"),
_PATH_DEVNULL, strerror(errno)); _PATH_DEVNULL, strerror(errno));
goto cleanup; goto cleanup;
} }
if ((outfd != NULL && pipe(pipeout) < 0) || if ((outfd != NULL && pipe(pipeout) < 0) ||
(errfd != NULL && pipe(pipeerr) < 0)) { (errfd != NULL && pipe(pipeerr) < 0)) {
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot create pipe : %s", ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
strerror(errno)); _("cannot create pipe: %s"), strerror(errno));
goto cleanup; goto cleanup;
} }
if ((pid = fork()) < 0) { if ((pid = fork()) < 0) {
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot fork child process : %s", ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
strerror(errno)); _("cannot fork child process: %s"), strerror(errno));
goto cleanup; goto cleanup;
} }
@ -131,11 +132,11 @@ _virExec(virConnectPtr conn,
if(non_block) if(non_block)
if(virSetNonBlock(pipeout[0]) == -1) if(virSetNonBlock(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set non-blocking file descriptor flag"); _("Failed to set non-blocking file descriptor flag"));
if(virSetCloseExec(pipeout[0]) == -1) if(virSetCloseExec(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set close-on-exec file descriptor flag"); _("Failed to set close-on-exec file descriptor flag"));
*outfd = pipeout[0]; *outfd = pipeout[0];
} }
if (errfd) { if (errfd) {
@ -143,11 +144,11 @@ _virExec(virConnectPtr conn,
if(non_block) if(non_block)
if(virSetNonBlock(pipeerr[0]) == -1) if(virSetNonBlock(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set non-blocking file descriptor flag"); _("Failed to set non-blocking file descriptor flag"));
if(virSetCloseExec(pipeerr[0]) == -1) if(virSetCloseExec(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set close-on-exec file descriptor flag"); _("Failed to set close-on-exec file descriptor flag"));
*errfd = pipeerr[0]; *errfd = pipeerr[0];
} }
*retpid = pid; *retpid = pid;