more info output for tmpfile open
to help diagnose problems
This commit is contained in:
parent
0bea76d364
commit
d4815e8b7e
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue