]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Adjust for wait_subprocess change.
authorBruno Haible <bruno@clisp.org>
Fri, 13 Jun 2003 13:04:23 +0000 (13:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:40 +0000 (12:10 +0200)
Avoid msginit failure if one of the shell scripts is not present.

gettext-tools/src/ChangeLog
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/read-java.c
gettext-tools/src/read-tcl.c

index 56090796a5fabe51eb6a237e980ffc9a6a595d3e..f237a9ab85ac64abd9a4656b6ccdd3e3a30433e7 100644 (file)
@@ -1,3 +1,14 @@
+2003-06-13  Bruno Haible  <bruno@clisp.org>
+
+       * msgexec.c (process_string): Pass null_stderr=false.
+       * msgfilter.c (process_string): Likewise.
+       * msggrep.c (is_string_selected): Likewise.
+       * read-java.c (execute_and_read_po_output): Likewise.
+       * read-tcl.c (msgdomain_read_tcl): Likewise.
+       * msginit.c (project_id, project_id_version, get_user_email,
+       language_team_address): Return a default value if the subprocess
+       fails, instead of exiting.
+
 2003-06-12  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (noinst_HEADERS): Add x-perl.h.
index 8e98aa4fc9313b9c31f2aeeb34aa5765527b29cd..a53a333d95ffc8f33546f525e9d4a7603af4c7e8 100644 (file)
@@ -334,7 +334,7 @@ process_string (const message_ty *mp, const char *str, size_t len)
       close (fd[0]);
 
       /* Remove zombie process from process list, and retrieve exit status.  */
-      exitstatus = wait_subprocess (child, sub_name, true);
+      exitstatus = wait_subprocess (child, sub_name, false, true);
       if (exitcode < exitstatus)
        exitcode = exitstatus;
     }
index 075b0ca8d5245b43195708938f58fb0243c24358..55455b2b29cf9aab0cc6216b7ba5afabf5852215 100644 (file)
@@ -657,7 +657,7 @@ process_string (const char *str, size_t len, char **resultp, size_t *lengthp)
   close (fd[0]);
 
   /* Remove zombie process from process list.  */
-  exitstatus = wait_subprocess (child, sub_name, true);
+  exitstatus = wait_subprocess (child, sub_name, false, true);
   if (exitstatus != 0)
     error (EXIT_FAILURE, 0, _("%s subprocess terminated with exit code %d"),
           sub_name, exitstatus);
index f6928a5265d9afe8606c7ad96c5709d06f946c29..940b46dbdb80dcbace8c172e30a49cf90ff9d18e 100644 (file)
@@ -583,7 +583,7 @@ is_string_selected (int grep_pass, const char *str, size_t len)
       close (fd[0]);
 
       /* Remove zombie process from process list, and retrieve exit status.  */
-      exitstatus = wait_subprocess (child, "grep", true);
+      exitstatus = wait_subprocess (child, "grep", false, true);
       return (exitstatus == 0);
     }
   else
index c348eaf69bfabae4bdc124a72444151f9fe319fe..ace4a83477f2cec02747e15209ddee20999b2fa9 100644 (file)
@@ -897,29 +897,43 @@ project_id ()
   argv[0] = "/bin/sh";
   argv[1] = prog;
   argv[2] = NULL;
-  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
+  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, false, fd);
+  if (child == -1)
+    goto failed;
 
   /* Retrieve its result.  */
   fp = fdopen (fd[0], "r");
   if (fp == NULL)
-    error (EXIT_FAILURE, errno, _("fdopen() failed"));
+    {
+      error (0, errno, _("fdopen() failed"));
+      goto failed;
+    }
 
   line = NULL; linesize = 0;
   linelen = getline (&line, &linesize, fp);
   if (linelen == (size_t)(-1))
-    error (EXIT_FAILURE, 0, _("%s subprocess I/O error"), prog);
+    {
+      error (0, 0, _("%s subprocess I/O error"), prog);
+      goto failed;
+    }
   if (linelen > 0 && line[linelen - 1] == '\n')
     line[linelen - 1] = '\0';
 
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, prog, true);
+  exitstatus = wait_subprocess (child, prog, false, false);
   if (exitstatus != 0)
-    error (EXIT_FAILURE, 0, _("%s subprocess failed with exit code %d"),
-          prog, exitstatus);
+    {
+      error (0, 0, _("%s subprocess failed with exit code %d"),
+            prog, exitstatus);
+      goto failed;
+    }
 
   return line;
+
+failed:
+  return "PACKAGE";
 }
 
 
@@ -949,29 +963,43 @@ project_id_version ()
   argv[1] = prog;
   argv[2] = "yes";
   argv[3] = NULL;
-  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
+  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, false, fd);
+  if (child == -1)
+    goto failed;
 
   /* Retrieve its result.  */
   fp = fdopen (fd[0], "r");
   if (fp == NULL)
-    error (EXIT_FAILURE, errno, _("fdopen() failed"));
+    {
+      error (0, errno, _("fdopen() failed"));
+      goto failed;
+    }
 
   line = NULL; linesize = 0;
   linelen = getline (&line, &linesize, fp);
   if (linelen == (size_t)(-1))
-    error (EXIT_FAILURE, 0, _("%s subprocess I/O error"), prog);
+    {
+      error (0, 0, _("%s subprocess I/O error"), prog);
+      goto failed;
+    }
   if (linelen > 0 && line[linelen - 1] == '\n')
     line[linelen - 1] = '\0';
 
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, prog, true);
+  exitstatus = wait_subprocess (child, prog, false, false);
   if (exitstatus != 0)
-    error (EXIT_FAILURE, 0, _("%s subprocess failed with exit code %d"),
-          prog, exitstatus);
+    {
+      error (0, 0, _("%s subprocess failed with exit code %d"),
+            prog, exitstatus);
+      goto failed;
+    }
 
   return line;
+
+failed:
+  return "PACKAGE VERSION";
 }
 
 
@@ -1092,29 +1120,43 @@ The new message catalog should contain your email address, so that users can\n\
 give you feedback about the translations, and so that maintainers can contact\n\
 you in case of unexpected technical problems.\n");
   argv[3] = NULL;
-  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
+  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, false, fd);
+  if (child == -1)
+    goto failed;
 
   /* Retrieve his answer.  */
   fp = fdopen (fd[0], "r");
   if (fp == NULL)
-    error (EXIT_FAILURE, errno, _("fdopen() failed"));
+    {
+      error (0, errno, _("fdopen() failed"));
+      goto failed;
+    }
 
   line = NULL; linesize = 0;
   linelen = getline (&line, &linesize, fp);
   if (linelen == (size_t)(-1))
-    error (EXIT_FAILURE, 0, _("%s subprocess I/O error"), prog);
+    {
+      error (0, 0, _("%s subprocess I/O error"), prog);
+      goto failed;
+    }
   if (linelen > 0 && line[linelen - 1] == '\n')
     line[linelen - 1] = '\0';
 
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, prog, true);
+  exitstatus = wait_subprocess (child, prog, false, false);
   if (exitstatus != 0)
-    error (EXIT_FAILURE, 0, _("%s subprocess failed with exit code %d"),
-          prog, exitstatus);
+    {
+      error (0, 0, _("%s subprocess failed with exit code %d"),
+            prog, exitstatus);
+      goto failed;
+    }
 
   return line;
+
+failed:
+  return "EMAIL@ADDRESS";
 }
 
 
@@ -1159,12 +1201,17 @@ language_team_address ()
   argv[4] = (char *) catalogname;
   argv[5] = (char *) language;
   argv[6] = NULL;
-  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, true, fd);
+  child = create_pipe_in (prog, "/bin/sh", argv, DEV_NULL, false, false, fd);
+  if (child == -1)
+    goto failed;
 
   /* Retrieve its result.  */
   fp = fdopen (fd[0], "r");
   if (fp == NULL)
-    error (EXIT_FAILURE, errno, _("fdopen() failed"));
+    {
+      error (0, errno, _("fdopen() failed"));
+      goto failed;
+    }
 
   line = NULL; linesize = 0;
   linelen = getline (&line, &linesize, fp);
@@ -1176,12 +1223,18 @@ language_team_address ()
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, prog, true);
+  exitstatus = wait_subprocess (child, prog, false, false);
   if (exitstatus != 0)
-    error (EXIT_FAILURE, 0, _("%s subprocess failed with exit code %d"),
-          prog, exitstatus);
+    {
+      error (0, 0, _("%s subprocess failed with exit code %d"),
+            prog, exitstatus);
+      goto failed;
+    }
 
   return line;
+
+failed:
+  return "";
 }
 
 
index 5d9fbf1329f009679b2098f8c2d372774b03d939..0fdb177b128b020b109f906c6d4ef830531adb99 100644 (file)
@@ -76,7 +76,7 @@ execute_and_read_po_output (const char *progname,
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, progname, true);
+  exitstatus = wait_subprocess (child, progname, false, true);
   if (exitstatus != 0)
     error (EXIT_FAILURE, 0, _("%s subprocess failed with exit code %d"),
           progname, exitstatus);
index 38fdc07f0e611ed110e4d1c4039770b9089ca661..b1253bff0180706e6a11dcea5d43f3c8eafcf917 100644 (file)
@@ -112,7 +112,7 @@ msgdomain_read_tcl (const char *locale_name, const char *directory)
   fclose (fp);
 
   /* Remove zombie process from process list, and retrieve exit status.  */
-  exitstatus = wait_subprocess (child, "tclsh", true);
+  exitstatus = wait_subprocess (child, "tclsh", false, true);
   if (exitstatus != 0)
     {
       if (exitstatus == 2)