@@ -1172,10 +1172,22 @@ int main(int argc, char **argv) {
{0, 0, 0, 0}
};
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL ||
- virInitialize() < 0) {
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (virInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
}
@@ -1179,10 +1179,22 @@ int main(int argc, char **argv) {
privileged = geteuid() == 0;
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL ||
- virThreadInitialize() < 0 ||
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (virThreadInitialize() < 0 ||
virErrorInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
@@ -70,10 +70,18 @@ main(int argc, char **argv)
.cb = authCallback,
};
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
exit(EXIT_FAILURE);
}
@@ -936,10 +936,22 @@ int main(int argc, char **argv) {
privileged = geteuid() == 0;
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL ||
- virThreadInitialize() < 0 ||
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (virThreadInitialize() < 0 ||
virErrorInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
@@ -2505,10 +2505,22 @@ int main(int argc, char *argv[])
for (i = 0; i < VIR_LXC_DOMAIN_NAMESPACE_LAST; i++)
ns_fd[i] = -1;
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL ||
- virThreadInitialize() < 0 ||
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (virThreadInitialize() < 0 ||
virErrorInitialize() < 0) {
fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
exit(EXIT_FAILURE);
@@ -115,10 +115,18 @@ main(int argc, char **argv)
program_name = argv[0];
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), program_name);
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
exit(EXIT_FAILURE);
}
@@ -1298,10 +1298,18 @@ main(int argc, char **argv)
char *profile = NULL;
char *include_file = NULL;
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
exit(EXIT_FAILURE);
}
@@ -72,10 +72,18 @@ int main(int argc, char **argv)
const char *partsep;
bool devmap_nopartsep = false;
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
exit(EXIT_FAILURE);
}
@@ -230,10 +230,18 @@ main(int argc, char **argv)
program_name = argv[0];
- if (setlocale(LC_ALL, "") == NULL ||
- bindtextdomain(PACKAGE, LOCALEDIR) == NULL ||
- textdomain(PACKAGE) == NULL) {
- fprintf(stderr, _("%s: initialization failed\n"), program_name);
+ if (!setlocale(LC_ALL, "")) {
+ perror("setlocale");
+ /* failure to setup locale is not fatal */
+ }
+
+ if (!bindtextdomain(PACKAGE, LOCALEDIR)) {
+ perror("bindtextdomain");
+ exit(EXIT_FAILURE);
+ }
+
+ if (!textdomain(PACKAGE)) {
+ perror("textdomain");
exit(EXIT_FAILURE);
}