From d4815e8b7e63411bf585afd63afe40102eaf2530 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 21 Nov 2018 14:26:52 +0000 Subject: [PATCH] more info output for tmpfile open to help diagnose problems --- ChangeLog | 3 +++ configure.ac | 6 +++--- libvips/iofuncs/vips.c | 18 ++++++++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bedc0fa8..077ab5d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +21/11/18 started 8.7.2 +- more info output for temp files to help diagnose problems + 23/9/18 started 8.7.1 - update function list in docs [janko-m] - test for g_str_to_ascii() [jcupitt] diff --git a/configure.ac b/configure.ac index c82fe564..15b0e243 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # also update the version number in the m4 macros below -AC_INIT([vips], [8.7.1], [vipsip@jiscmail.ac.uk]) +AC_INIT([vips], [8.7.2], [vipsip@jiscmail.ac.uk]) # required for gobject-introspection AC_PREREQ(2.62) @@ -18,7 +18,7 @@ AC_CONFIG_MACRO_DIR([m4]) # user-visible library versioning m4_define([vips_major_version], [8]) m4_define([vips_minor_version], [7]) -m4_define([vips_micro_version], [1]) +m4_define([vips_micro_version], [2]) m4_define([vips_version], [vips_major_version.vips_minor_version.vips_micro_version]) @@ -38,7 +38,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date -u -r ChangeLog` # binary interface changes not backwards compatible?: reset age to 0 LIBRARY_CURRENT=51 -LIBRARY_REVISION=1 +LIBRARY_REVISION=2 LIBRARY_AGE=9 # patched into include/vips/version.h diff --git a/libvips/iofuncs/vips.c b/libvips/iofuncs/vips.c index c224bdba..1e0ddc9b 100644 --- a/libvips/iofuncs/vips.c +++ b/libvips/iofuncs/vips.c @@ -189,6 +189,11 @@ vips__open_image_write( const char *filename, gboolean temp ) fd = -1; +#ifndef O_TMPFILE + if( temp ) + g_info( "vips__open_image_write: O_TMPFILE not available" ); +#endif /*!O_TMPFILE*/ + #ifdef O_TMPFILE /* Linux-only extension creates an unlinked file. CREAT and TRUNC must * be clear. The filename arg to open() must name a directory. @@ -200,9 +205,13 @@ vips__open_image_write( const char *filename, gboolean temp ) if( temp ) { char *dirname; + g_info( "vips__open_image_write: opening with O_TMPFILE" ); dirname = g_path_get_dirname( filename ); fd = vips_tracked_open( dirname, O_TMPFILE | O_RDWR , 0666 ); g_free( dirname ); + + if( fd < 0 ) + g_info( "vips__open_image_write: O_TMPFILE failed!" ); } #endif /*O_TMPFILE*/ @@ -212,14 +221,19 @@ vips__open_image_write( const char *filename, gboolean temp ) /* On Windows, setting _O_TEMPORARY will delete the file automatically * on process exit, even if the processes crashes. */ - if( temp ) + if( temp ) { + g_info( "vips__open_image_write: setting _O_TEMPORARY" ); flags |= _O_TEMPORARY; + } #endif /*_O_TEMPORARY*/ - if( fd < 0 ) + if( fd < 0 ) { + g_info( "vips__open_image_write: simple open" ); fd = vips_tracked_open( filename, flags, 0666 ); + } if( fd < 0 ) { + g_info( "vips__open_image_write: failed!" ); vips_error_system( errno, "VipsImage", _( "unable to write to \"%s\"" ), filename ); return( -1 );