[GRASS-SVN] r40650 - grass/branches/releasebranch_6_4/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 25 20:08:55 EST 2010


Author: neteler
Date: 2010-01-25 20:08:55 -0500 (Mon, 25 Jan 2010)
New Revision: 40650

Modified:
   grass/branches/releasebranch_6_4/lib/gis/spawn.c
Log:
glynn: return the exit code (intentionally partial backport of r40647)

Modified: grass/branches/releasebranch_6_4/lib/gis/spawn.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/spawn.c	2010-01-26 01:06:52 UTC (rev 40649)
+++ grass/branches/releasebranch_6_4/lib/gis/spawn.c	2010-01-26 01:08:55 UTC (rev 40650)
@@ -685,6 +685,14 @@
 
 	if (n != pid)
 	    status = -1;
+	else {
+	    if (WIFEXITED(status))
+		status = WEXITSTATUS(status);
+	    else if (WIFSIGNALED(status))
+		status = WTERMSIG(status);
+	    else
+		status = -0x100;
+	}
     }
 
     undo_signals(sp->signals, sp->num_signals, SST_POST);



More information about the grass-commit mailing list