[GRASS-SVN] r37193 - grass/branches/develbranch_6/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 12 07:19:49 EDT 2009
Author: hamish
Date: 2009-05-12 07:19:49 -0400 (Tue, 12 May 2009)
New Revision: 37193
Modified:
grass/branches/develbranch_6/lib/gis/spawn.c
Log:
backport some fixes from trunk r34695
Modified: grass/branches/develbranch_6/lib/gis/spawn.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/spawn.c 2009-05-12 10:45:06 UTC (rev 37192)
+++ grass/branches/develbranch_6/lib/gis/spawn.c 2009-05-12 11:19:49 UTC (rev 37193)
@@ -61,13 +61,13 @@
int G_spawn(const char *command, ...)
{
va_list va;
- char *args[MAX_ARGS];
+ const char *args[MAX_ARGS];
int num_args = 0;
va_start(va, command);
for (num_args = 0; num_args < MAX_ARGS;) {
- char *arg = va_arg(va, char *);
+ const char *arg = va_arg(va, const char *);
args[num_args++] = arg;
if (!arg)
@@ -81,7 +81,7 @@
return -1;
}
- return _spawnvp(_P_WAIT, (char *)command, args);
+ return _spawnvp(_P_WAIT, command, args);
}
#else
@@ -204,7 +204,7 @@
#ifdef __MINGW32__
-static int do_redirects(struct redirect *redirects, int num_redirects)
+static void do_redirects(struct redirect *redirects, int num_redirects)
{
if (num_redirects > 0)
G_fatal_error
@@ -221,19 +221,18 @@
return env;
}
-static int do_spawn(const char *command)
+static int do_spawn(struct spawn *sp, const char *command)
{
char **env;
int status;
- do_redirects(redirects, num_redirects);
- env = do_bindings(_environ, bindings, num_bindings);
+ do_redirects(sp->redirects, sp->num_redirects);
+ env = do_bindings(_environ, sp->bindings, sp->num_bindings);
status =
- spawnvpe(background ? _P_NOWAIT : _P_WAIT, command, (char **)args,
- env);
+ spawnvpe(sp->background ? _P_NOWAIT : _P_WAIT, command, sp->args, env);
- if (!background && status < 0)
+ if (!sp->background && status < 0)
G_warning(_("Unable to execute command"));
return status;
More information about the grass-commit
mailing list