From 3163224bb5f4fb8cb2addcc34cbc3e171537037e Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 27 Mar 2008 13:47:00 +0000
Subject: [PATCH] ReportError: mark for translation string args to this
 function

* Makefile.maint (msg_gen_function): Add ReportError.
* src/util.c (_virExec): Mark strings.
---
 ChangeLog      |  4 ++++
 Makefile.maint |  2 +-
 src/util.c     | 21 +++++++++++----------
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e94085e035..6cbb171cbc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 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
 	* Makefile.maint (msg_gen_function): Add xenXMError.
 	* src/xm_internal.c (xenXMParseXMLToConfig, xenXMDomainDefineXML):
diff --git a/Makefile.maint b/Makefile.maint
index ff09660dac..ccf6f5d604 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -313,9 +313,9 @@ msg_gen_function += qemudLog
 msg_gen_function += remoteDispatchError
 msg_gen_function += virStorageLog
 msg_gen_function += xenXMError
+msg_gen_function += ReportError
 
 # msg_gen_function += virXenError
-# msg_gen_function += ReportError
 # msg_gen_function += testError
 # msg_gen_function += openvzLog
 # msg_gen_function += qemudReportError
diff --git a/src/util.c b/src/util.c
index 188b7a82f2..0667780864 100644
--- a/src/util.c
+++ b/src/util.c
@@ -106,21 +106,22 @@ _virExec(virConnectPtr conn,
     int pipeerr[2] = {-1,-1};
 
     if ((null = open(_PATH_DEVNULL, O_RDONLY)) < 0) {
-        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot open %s : %s",
-                         _PATH_DEVNULL, strerror(errno));
+        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                    _("cannot open %s: %s"),
+                    _PATH_DEVNULL, strerror(errno));
         goto cleanup;
     }
 
     if ((outfd != NULL && pipe(pipeout) < 0) ||
         (errfd != NULL && pipe(pipeerr) < 0)) {
-        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot create pipe : %s",
-                         strerror(errno));
+        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                    _("cannot create pipe: %s"), strerror(errno));
         goto cleanup;
     }
 
     if ((pid = fork()) < 0) {
-        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "cannot fork child process : %s",
-                         strerror(errno));
+        ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+                    _("cannot fork child process: %s"), strerror(errno));
         goto cleanup;
     }
 
@@ -131,11 +132,11 @@ _virExec(virConnectPtr conn,
             if(non_block)
                 if(virSetNonBlock(pipeout[0]) == -1)
                     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)
                 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];
         }
         if (errfd) {
@@ -143,11 +144,11 @@ _virExec(virConnectPtr conn,
             if(non_block)
                 if(virSetNonBlock(pipeerr[0]) == -1)
                     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)
                 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];
         }
         *retpid = pid;