summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-05-17 14:55:33 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:10:30 +0200
commitff2d1ed196ea032538081100f1e5ed178a25aef8 (patch)
tree73c93cd686a79bbb96da286c92cf715c9ee3366c /gettext-tools
parentebdd3084ef8c87bb36df85d02800f57a70a1f4b1 (diff)
downloadexternal_gettext-ff2d1ed196ea032538081100f1e5ed178a25aef8.zip
external_gettext-ff2d1ed196ea032538081100f1e5ed178a25aef8.tar.gz
external_gettext-ff2d1ed196ea032538081100f1e5ed178a25aef8.tar.bz2
Make it work on Woe32.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/lib/ChangeLog6
-rw-r--r--gettext-tools/lib/execute.c14
-rw-r--r--gettext-tools/lib/w32spawn.h6
3 files changed, 17 insertions, 9 deletions
diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog
index 8265fee..6788a7e 100644
--- a/gettext-tools/lib/ChangeLog
+++ b/gettext-tools/lib/ChangeLog
@@ -3,6 +3,12 @@
* Makefile.msvc (OBJECTS): Remove strpbrk.obj.
(strpbrk.obj): Remove rule.
+ * w32spawn.h (dup_noinherit): Cast _get_osfhandle result and
+ _open_osfhandle argument, to avoid warnings.
+ (prepare_spawn): Add a cast.
+ * execute.c (execute) [WIN32]: Don't call wait_subprocess; the
+ return value from spawnvp is already the exit code.
+
2003-05-10 Bruno Haible <bruno@clisp.org>
* linebreak.c (iconv_string_length): Don't return -1 just because the
diff --git a/gettext-tools/lib/execute.c b/gettext-tools/lib/execute.c
index 6754bc1..3c8be27 100644
--- a/gettext-tools/lib/execute.c
+++ b/gettext-tools/lib/execute.c
@@ -122,7 +122,7 @@ execute (const char *progname,
int orig_stdin;
int orig_stdout;
int orig_stderr;
- int child;
+ int exitcode;
int nullinfd;
int nulloutfd;
@@ -135,7 +135,7 @@ execute (const char *progname,
orig_stdout = dup_noinherit (STDOUT_FILENO);
if (null_stderr)
orig_stderr = dup_noinherit (STDERR_FILENO);
- child = -1;
+ exitcode = -1;
/* Create standard file handles of child process. */
nullinfd = -1;
@@ -156,7 +156,7 @@ execute (const char *progname,
&& ((null_stdout && nulloutfd == STDOUT_FILENO)
|| (null_stderr && nulloutfd == STDERR_FILENO)
|| close (nulloutfd) >= 0))))
- child = spawnvp (P_WAIT, prog_path, prog_argv);
+ exitcode = spawnvp (P_WAIT, prog_path, prog_argv);
if (nulloutfd >= 0)
close (nulloutfd);
if (nullinfd >= 0)
@@ -170,7 +170,7 @@ execute (const char *progname,
if (null_stdin)
dup2 (orig_stdin, STDIN_FILENO), close (orig_stdin);
- if (child == -1)
+ if (exitcode == -1)
{
if (exit_on_error)
error (EXIT_FAILURE, errno, _("%s subprocess failed"), progname);
@@ -178,6 +178,8 @@ execute (const char *progname,
return 127;
}
+ return exitcode;
+
#else
/* Unix API. */
@@ -265,7 +267,7 @@ execute (const char *progname,
}
#endif
-#endif
-
return wait_subprocess (child, progname, exit_on_error);
+
+#endif
}
diff --git a/gettext-tools/lib/w32spawn.h b/gettext-tools/lib/w32spawn.h
index e5c5c8e..ac37926 100644
--- a/gettext-tools/lib/w32spawn.h
+++ b/gettext-tools/lib/w32spawn.h
@@ -34,7 +34,7 @@ static int
dup_noinherit (int fd)
{
HANDLE curr_process = GetCurrentProcess ();
- HANDLE old_handle = _get_osfhandle (fd);
+ HANDLE old_handle = (HANDLE) _get_osfhandle (fd);
HANDLE new_handle;
int nfd;
@@ -48,7 +48,7 @@ dup_noinherit (int fd)
error (EXIT_FAILURE, 0, _("DuplicateHandle failed with error code 0x%08x"),
GetLastError ());
- nfd = _open_osfhandle (new_handle, O_BINARY);
+ nfd = _open_osfhandle ((long) new_handle, O_BINARY);
if (nfd < 0)
error (EXIT_FAILURE, errno, _("_open_osfhandle failed"));
@@ -161,7 +161,7 @@ prepare_spawn (char **argv)
new_argv[i] = quoted_string;
}
else
- new_argv[i] = string;
+ new_argv[i] = (char *) string;
}
new_argv[argc] = NULL;