diff --git a/ChangeLog b/ChangeLog index 4a21631d..f85a91cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 26/11/21 started 8.12.2 - make exif resuint optional and default to inch +- win: don't set create time on inappropriate file descriptors [lovell] 21/11/21 started 8.12.1 - fix insert [chregu] diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c index 8c13597e..6e0fe6c0 100644 --- a/libvips/iofuncs/util.c +++ b/libvips/iofuncs/util.c @@ -618,7 +618,8 @@ vips__open( const char *filename, int flags, int mode ) fd = g_open( filename, flags, mode ); #ifdef G_OS_WIN32 - if( mode & O_CREAT ) + if( fd != -1 && + (mode & O_CREAT) ) vips__set_create_time( fd ); #endif /*G_OS_WIN32*/ @@ -641,7 +642,8 @@ vips__fopen( const char *filename, const char *mode ) fp = g_fopen( filename, mode ); #ifdef G_OS_WIN32 - if( fp && mode[0] == 'w' ) + if( fp && + mode[0] == 'w' ) vips__set_create_time( _fileno( fp ) ); #endif /*G_OS_WIN32*/