提交 0c316338 编写于 作者: J Jim Meyering

libvirtd: mark strings for translation, including --help output

* daemon/libvirtd.c (daemonForkIntoBackground, main): Mark strings
for translation.
(usage): Rework --help so that it is translatable, replacing
each embedded, configuration-dependent, macro with an `%s'.

libvirtd: don't ignore virInitialize failure
* daemon/libvirtd.c (main): Diagnose virInitialize failure
and exit nonzero.
上级 0e1f4633
...@@ -484,8 +484,8 @@ static int daemonForkIntoBackground(void) { ...@@ -484,8 +484,8 @@ static int daemonForkIntoBackground(void) {
if (ret == 1 && status != 0) { if (ret == 1 && status != 0) {
fprintf(stderr, fprintf(stderr,
"error: %s. Check /var/log/messages or run without " _("error: %s. Check /var/log/messages or run without "
"--daemon for more info.\n", "--daemon for more info.\n"),
virDaemonErrTypeToString(status)); virDaemonErrTypeToString(status));
} }
_exit(ret == 1 && status == 0 ? 0 : 1); _exit(ret == 1 && status == 0 ? 0 : 1);
...@@ -2963,7 +2963,7 @@ static void ...@@ -2963,7 +2963,7 @@ static void
usage (const char *argv0) usage (const char *argv0)
{ {
fprintf (stderr, fprintf (stderr,
"\n\ _("\n\
Usage:\n\ Usage:\n\
%s [options]\n\ %s [options]\n\
\n\ \n\
...@@ -2981,27 +2981,33 @@ libvirt management daemon:\n\ ...@@ -2981,27 +2981,33 @@ libvirt management daemon:\n\
Default paths:\n\ Default paths:\n\
\n\ \n\
Configuration file (unless overridden by -f):\n\ Configuration file (unless overridden by -f):\n\
" SYSCONF_DIR "/libvirt/libvirtd.conf\n\ %s/libvirt/libvirtd.conf\n\
\n\ \n\
Sockets (as root):\n\ Sockets (as root):\n\
" LOCAL_STATE_DIR "/run/libvirt/libvirt-sock\n\ %s/run/libvirt/libvirt-sock\n\
" LOCAL_STATE_DIR "/run/libvirt/libvirt-sock-ro\n\ %s/run/libvirt/libvirt-sock-ro\n\
\n\ \n\
Sockets (as non-root):\n\ Sockets (as non-root):\n\
$HOME/.libvirt/libvirt-sock (in UNIX abstract namespace)\n\ $HOME/.libvirt/libvirt-sock (in UNIX abstract namespace)\n\
\n\ \n\
TLS:\n\ TLS:\n\
CA certificate: " LIBVIRT_CACERT "\n\ CA certificate: %s\n\
Server certificate: " LIBVIRT_SERVERCERT "\n\ Server certificate: %s\n\
Server private key: " LIBVIRT_SERVERKEY "\n\ Server private key: %s\n\
\n\ \n\
PID file (unless overridden by --pid-file):\n\ PID file (unless overridden by --pid-file):\n\
%s\n\ %s\n\
\n", \n"),
argv0, argv0,
REMOTE_PID_FILE[0] != '\0' SYSCONF_DIR,
? REMOTE_PID_FILE LOCAL_STATE_DIR,
: "(disabled in ./configure)"); LOCAL_STATE_DIR,
LIBVIRT_CACERT,
LIBVIRT_SERVERCERT,
LIBVIRT_SERVERKEY,
(REMOTE_PID_FILE[0] != '\0'
? REMOTE_PID_FILE
: _("(disabled in ./configure)")));
} }
enum { enum {
...@@ -3083,7 +3089,7 @@ int main(int argc, char **argv) { ...@@ -3083,7 +3089,7 @@ int main(int argc, char **argv) {
return 2; return 2;
default: default:
fprintf (stderr, "libvirtd: internal error: unknown flag: %c\n", fprintf (stderr, _("libvirtd: internal error: unknown flag: %c\n"),
c); c);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册