]> xenbits.xensource.com Git - libvirt.git/commitdiff
logging: Update format strings in translated messages
authorJiri Denemark <jdenemar@redhat.com>
Thu, 9 Mar 2023 11:18:13 +0000 (12:18 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Sat, 1 Apr 2023 09:40:33 +0000 (11:40 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/logging/log_cleaner.c
src/logging/log_daemon.c
src/logging/log_daemon_dispatch.c
src/logging/log_handler.c

index 38f818f1779aa82b2e78344c8544365428226de6..4ee91843aa403bc61c657f5ada1ce18a46ea55e0 100644 (file)
@@ -87,7 +87,7 @@ virLogCleanerParseFilename(const char *path,
 
     if (virStrToLong_i(rotated_index_str, NULL, 10, rotated_index) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to parse rotated index from '%s'"),
+                       _("Failed to parse rotated index from '%1$s'"),
                        rotated_index_str);
         return NULL;
     }
index b4db58581094f4d4d9e3ae02ac7e0b11464b05f6..daf7ef4b2ffe7e3bbc12b11a4ca2530ba38e930c 100644 (file)
@@ -190,7 +190,7 @@ virLogDaemonNewServerPostExecRestart(virNetDaemon *dmn,
                                               dmn);
     } else {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unexpected server name '%s' during restart"),
+                       _("Unexpected server name '%1$s' during restart"),
                        name);
         return NULL;
     }
@@ -336,14 +336,14 @@ virLogDaemonClientNew(virNetServerClient *client,
 
     if (!privileged) {
         if (geteuid() != clientuid) {
-            virReportRestrictedError(_("Disallowing client %llu with uid %llu"),
+            virReportRestrictedError(_("Disallowing client %1$llu with uid %2$llu"),
                                      (unsigned long long)priv->clientPid,
                                      (unsigned long long)clientuid);
             goto error;
         }
     } else {
         if (clientuid != 0) {
-            virReportRestrictedError(_("Disallowing client %llu with uid %llu"),
+            virReportRestrictedError(_("Disallowing client %1$llu with uid %2$llu"),
                                      (unsigned long long)priv->clientPid,
                                      (unsigned long long)clientuid);
             goto error;
@@ -518,7 +518,7 @@ virLogDaemonPreExecRestart(const char *state_file,
 
     if (virFileWriteStr(state_file, state, 0700) < 0) {
         virReportSystemError(errno,
-                             _("Unable to save state file %s"), state_file);
+                             _("Unable to save state file %1$s"), state_file);
         return -1;
     }
 
@@ -540,7 +540,7 @@ virLogDaemonUsage(const char *argv0, bool privileged)
     fprintf(stderr,
             _("\n"
               "Usage:\n"
-              "  %s [options]\n"
+              "  %1$s [options]\n"
               "\n"
               "Options:\n"
               "  -h | --help            Display program help:\n"
@@ -559,13 +559,13 @@ virLogDaemonUsage(const char *argv0, bool privileged)
                   "  Default paths:\n"
                   "\n"
                   "    Configuration file (unless overridden by -f):\n"
-                  "      %s/libvirt/virtlogd.conf\n"
+                  "      %1$s/libvirt/virtlogd.conf\n"
                   "\n"
                   "    Sockets:\n"
-                  "      %s/libvirt/virtlogd-sock\n"
+                  "      %2$s/libvirt/virtlogd-sock\n"
                   "\n"
                   "    PID file (unless overridden by -p):\n"
-                  "      %s/virtlogd.pid\n"
+                  "      %3$s/virtlogd.pid\n"
                   "\n"),
                 SYSCONFDIR,
                 RUNSTATEDIR,
@@ -625,7 +625,7 @@ int main(int argc, char **argv) {
 
     if (virGettextInitialize() < 0 ||
         virErrorInitialize() < 0) {
-        fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
+        fprintf(stderr, _("%1$s: initialization failed\n"), argv[0]);
         exit(EXIT_FAILURE);
     }
 
@@ -705,7 +705,7 @@ int main(int argc, char **argv) {
     /* Read the config file if it exists */
     if (remote_config_file &&
         virLogDaemonConfigLoadFile(config, remote_config_file, implicit_conf) < 0) {
-        VIR_ERROR(_("Can't load config file: %s: %s"),
+        VIR_ERROR(_("Can't load config file: %1$s: %2$s"),
                   virGetLastErrorMessage(), remote_config_file);
         exit(EXIT_FAILURE);
     }
@@ -764,7 +764,7 @@ int main(int argc, char **argv) {
         old_umask = umask(077);
     VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
     if (g_mkdir_with_parents(run_dir, 0777) < 0) {
-        VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
+        VIR_ERROR(_("unable to create rundir %1$s: %2$s"), run_dir,
                   g_strerror(errno));
         ret = VIR_DAEMON_ERR_RUNDIR;
         umask(old_umask);
@@ -790,13 +790,13 @@ int main(int argc, char **argv) {
 
         if (godaemon) {
             if (chdir("/") < 0) {
-                VIR_ERROR(_("cannot change to root directory: %s"),
+                VIR_ERROR(_("cannot change to root directory: %1$s"),
                           g_strerror(errno));
                 goto cleanup;
             }
 
             if ((statuswrite = virDaemonForkIntoBackground(argv[0])) < 0) {
-                VIR_ERROR(_("Failed to fork as daemon: %s"),
+                VIR_ERROR(_("Failed to fork as daemon: %1$s"),
                           g_strerror(errno));
                 goto cleanup;
             }
index f7448155fc4e9b01050260741b1553c2a5a01b06..f1c8163cca43dc396b94c15b0a03a3163b09e0b9 100644 (file)
@@ -117,7 +117,7 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServer *server G_GNUC_UNUSE
 
     if (args->maxlen > VIR_LOG_MANAGER_PROTOCOL_STRING_MAX) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Requested data len %llu is larger than maximum %d"),
+                       _("Requested data len %1$llu is larger than maximum %2$d"),
                        (unsigned long long)args->maxlen,
                        VIR_LOG_MANAGER_PROTOCOL_STRING_MAX);
         goto cleanup;
index a739211c7ca62165cae6ef4f051f2652f6045468..71517bbbe5ff55ed353dca0f0e823059da710c07 100644 (file)
@@ -354,7 +354,7 @@ virLogHandlerDomainOpenLogFile(virLogHandler *handler,
         if (STREQ(virRotatingFileWriterGetPath(handler->files[i]->file),
                   path)) {
             virReportSystemError(EBUSY,
-                                 _("Cannot open log file: '%s'"),
+                                 _("Cannot open log file: '%1$s'"),
                                  path);
             goto error;
         }
@@ -471,7 +471,7 @@ virLogHandlerDomainGetLogFilePosition(virLogHandler *handler,
 
     if (!file) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("No open log file %s"),
+                       _("No open log file %1$s"),
                        path);
         goto cleanup;
     }