[GRASS5] Libgrass_gis on Mingw - open.c patch

Markus Neteler neteler at itc.it
Sat May 21 09:00:49 EDT 2005


On Fri, May 20, 2005 at 10:48:47PM +0100, Glynn Clements wrote:
> 
> Javier A. Yebrin wrote:
> 
> > I'll send the build errors as soon I get my work organized. I've started
> > with some real testing and recompilation. The current module undergoing this
> > test is r.average, which is presenting some problems because of system calls
> > to r.stats and r.recode.
> 
> Does the Windows runtime not support system(), or is r.average using
> Unix-specific features?

A question:
Is it wrong to use G_system() within r.average instead of system()?

--- main.c      15 Jan 2005 11:18:12 -0000      2.1
+++ main.c      18 May 2005 08:16:43 -0000      2.2
@@ -90,7 +90,7 @@
     tempfile2 = G_tempfile();
     sprintf (command, "%s -anC input='%s,%s' fs=space > %s",
        STATS, basemap->answer, covermap->answer, tempfile1);
-    if (stat = system(command))
+    if (stat = G_system(command))
     {
        unlink(tempfile1);
        fprintf (stderr, "%s: ERROR running %s command\n", me, STATS);
@@ -151,7 +151,7 @@
     fclose (fd2);
     sprintf (command, "%s input='%s' output='%s' < %s",
        RECODE, basemap->answer, outputmap->answer, tempfile2);
-    stat = system(command);
+    stat = G_system(command);
     unlink (tempfile1);
     unlink (tempfile2);
     exit(stat);

?

Markus




More information about the grass-dev mailing list