[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] [PATCH 3/9] ReportError: mark for translation string args to this function



ReportError: mark for translation string args to this function

Signed-off-by: Jim Meyering <meyering redhat com>
---
 Makefile.maint |    2 +-
 src/util.c     |   21 +++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/Makefile.maint b/Makefile.maint
index ff09660..ccf6f5d 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 188b7a8..0667780 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;
--
1.5.5.rc0.22.g467c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]