Don't return an error from TIFFWriteData() if BEENWRITING not set

This commit is contained in:
Frank Warmerdam 2000-09-14 20:22:58 +00:00
parent fb02956eb9
commit da97c5e0a4
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2000-09-14 Frank Warmerdam <warmerda@cs46980-c>
* tif_flush.c: Changed so that TIFFFlushData() doesn't return an
error when TIFF_BEENWRITING is not set. This ensures that the
directory contents can still be flushed by TIFFFlush().
2000-08-14 Frank Warmerdam <warmerda@rommel.atlsci.com>
* tif_open.c: Don't set MMAP for O_RDWR files.

View File

@ -1,4 +1,4 @@
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_flush.c,v 1.1 1999-07-27 21:50:27 mike Exp $ */
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_flush.c,v 1.2 2000-09-14 20:22:58 warmerda Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@ -45,12 +45,18 @@ TIFFFlush(TIFF* tif)
/*
* Flush buffered data to the file.
*
* Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING
* is not set, so that TIFFFlush() will proceed to write out the directory.
* The documentation says returning 1 is an error indicator, but not having
* been writing isn't exactly a an error. Hopefully this doesn't cause
* problems for other people.
*/
int
TIFFFlushData(TIFF* tif)
{
if ((tif->tif_flags & TIFF_BEENWRITING) == 0)
return (0);
return (1);
if (tif->tif_flags & TIFF_POSTENCODE) {
tif->tif_flags &= ~TIFF_POSTENCODE;
if (!(*tif->tif_postencode)(tif))
@ -58,3 +64,4 @@ TIFFFlushData(TIFF* tif)
}
return (TIFFFlushData1(tif));
}