[GRASS-SVN] r71631 - grass/trunk/lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 3 01:19:17 PDT 2017


Author: mmetz
Date: 2017-11-03 01:19:17 -0700 (Fri, 03 Nov 2017)
New Revision: 71631

Modified:
   grass/trunk/lib/raster/close.c
Log:
rasterlib: close data file only if it is open (not the case for GDAL links)

Modified: grass/trunk/lib/raster/close.c
===================================================================
--- grass/trunk/lib/raster/close.c	2017-11-03 08:17:55 UTC (rev 71630)
+++ grass/trunk/lib/raster/close.c	2017-11-03 08:19:17 UTC (rev 71631)
@@ -174,7 +174,8 @@
     if (fcb->map_type != CELL_TYPE) {
 	Rast_quant_free(&fcb->quant);
     }
-    close(fcb->data_fd);
+    if (fcb->data_fd >= 0)
+	close(fcb->data_fd);
 
     return 1;
 }



More information about the grass-commit mailing list