소스 검색

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 년 전
부모
커밋
f43472b09c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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;
 }