Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
f43472b09c
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  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;
 }