[GRASS-SVN] r40711 - grass/trunk/general/g.parser
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 27 19:19:23 EST 2010
Author: glynn
Date: 2010-01-27 19:19:23 -0500 (Wed, 27 Jan 2010)
New Revision: 40711
Modified:
grass/trunk/general/g.parser/main.c
Log:
Use G_spawn() instead of _spawnlp()
Modified: grass/trunk/general/g.parser/main.c
===================================================================
--- grass/trunk/general/g.parser/main.c 2010-01-28 00:16:54 UTC (rev 40710)
+++ grass/trunk/general/g.parser/main.c 2010-01-28 00:19:23 UTC (rev 40711)
@@ -331,11 +331,14 @@
/* execlp( "sh", "sh", filename, "@ARGS_PARSED@", NULL); */
/* _spawnlp ( _P_OVERLAY, filename, filename, "@ARGS_PARSED@", NULL ); */
int ret;
+ char *shell = getenv("GRASS_SH");
- ret = _spawnlp(_P_WAIT, filename, filename, "@ARGS_PARSED@", NULL);
+ if (shell == NULL)
+ shell = "sh";
+ ret = G_spawn(shell, shell, filename, "@ARGS_PARSED@", NULL);
G_debug(1, "ret = %d", ret);
if (ret == -1) {
- perror("_spawnlp() failed");
+ perror("G_spawn() failed");
return 1;
}
return ret;
More information about the grass-commit
mailing list