Browse Source

rasterlib: close data file only if it is open (not the case for GDAL links)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71631 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 years ago
parent
commit
f43472b09c
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/raster/close.c

+ 2 - 1
lib/raster/close.c

@@ -174,7 +174,8 @@ static int close_old(int fd)
     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;
 }