[GRASS-SVN] r69225 - grass/branches/releasebranch_7_0/lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 23 02:28:38 PDT 2016


Author: martinl
Date: 2016-08-23 02:28:38 -0700 (Tue, 23 Aug 2016)
New Revision: 69225

Modified:
   grass/branches/releasebranch_7_0/lib/raster/open.c
Log:
G__tempfile() lacks perror support (fix #2278, backport r69223 from trunk)

Modified: grass/branches/releasebranch_7_0/lib/raster/open.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/open.c	2016-08-23 09:26:04 UTC (rev 69224)
+++ grass/branches/releasebranch_7_0/lib/raster/open.c	2016-08-23 09:28:38 UTC (rev 69225)
@@ -603,10 +603,11 @@
     tempname = G_tempfile();
     cell_fd = creat(tempname, 0666);
     if (cell_fd < 0) {
+        int err = errno;
 	G_free(mapset);
 	G_free(tempname);
 	G_free(map);
-	G_fatal_error(_("No temp files available: %s"), strerror(errno));
+	G_fatal_error(_("No temp files available: %s"), strerror(err));
     }
 
     fd = new_fileinfo();
@@ -673,12 +674,13 @@
     tempname = G_tempfile();
     fcb->null_fd = creat(tempname, 0666);
     if (fcb->null_fd < 0) {
+        int err = errno;
 	G_free(tempname);
 	G_free(fcb->name);
 	G_free(fcb->mapset);
 	G_free(fcb->temp_name);
 	close(cell_fd);
-	G_fatal_error(_("No temp files available: %s"), strerror(errno));
+	G_fatal_error(_("No temp files available: %s"), strerror(err));
     }
 
     fcb->null_temp_name = tempname;



More information about the grass-commit mailing list