From d59f9b354c873e267857dc53dd737cf08dc9eacb Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 11 Dec 2006 16:22:45 +0000 Subject: [PATCH] * forwardport: [18328]-[18330] * utf8_fopen for: galaktos and snapshots * vlc_closedir_wrapper for: webintf, mkv, ncurses and gnutls --- modules/control/http/util.c | 4 ++-- modules/demux/mkv.cpp | 2 +- modules/gui/ncurses.c | 2 +- modules/misc/gnutls.c | 4 ++-- modules/visualization/galaktos/preset.c | 4 ++-- src/video_output/vout_intf.c | 3 ++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/control/http/util.c b/modules/control/http/util.c index 8b53022f5f..a7857a696a 100644 --- a/modules/control/http/util.c +++ b/modules/control/http/util.c @@ -249,7 +249,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root, if( !f->name ) { msg_Err( p_intf , "unable to parse directory" ); - closedir( p_dir ); + vlc_closedir_wrapper( p_dir ); free( f ); return( VLC_ENOMEM ); } @@ -332,7 +332,7 @@ int E_(ParseDirectory)( intf_thread_t *p_intf, char *psz_root, } ACL_Destroy( p_acl ); - closedir( p_dir ); + vlc_closedir_wrapper( p_dir ); return VLC_SUCCESS; } diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp index c3feaf606a..6a2823c53c 100644 --- a/modules/demux/mkv.cpp +++ b/modules/demux/mkv.cpp @@ -1549,7 +1549,7 @@ static int Open( vlc_object_t * p_this ) } LocaleFree (psz_file); } - closedir( p_src_dir ); + vlc_closedir_wrapper( p_src_dir ); } } diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c index 857db4fb6e..15a77b9d7f 100644 --- a/modules/gui/ncurses.c +++ b/modules/gui/ncurses.c @@ -1995,7 +1995,7 @@ static void ReadDir( intf_thread_t *p_intf ) qsort( p_sys->pp_dir_entries, p_sys->i_dir_entries, sizeof(struct dir_entry_t*), &comp_dir_entries ); - closedir( p_current_dir ); + vlc_closedir_wrapper( p_current_dir ); return; } else diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c index 58a052af90..2ee21b3237 100644 --- a/modules/misc/gnutls.c +++ b/modules/misc/gnutls.c @@ -597,7 +597,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this, || fstat( fd, &st1 ) || utf8_lstat( psz_dirname, &st2 ) || S_ISLNK( st2.st_mode ) || ( st1.st_ino != st2.st_ino ) ) { - closedir( dir ); + vlc_closedir_wrapper( dir ); return VLC_EGENERIC; } } @@ -619,7 +619,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this, gnutls_Addx509File( p_this, cred, path, b_priv ); } - closedir( dir ); + vlc_closedir_wrapper( dir ); return VLC_SUCCESS; } diff --git a/modules/visualization/galaktos/preset.c b/modules/visualization/galaktos/preset.c index eff43d6cba..64a4ce98cf 100644 --- a/modules/visualization/galaktos/preset.c +++ b/modules/visualization/galaktos/preset.c @@ -520,7 +520,7 @@ int load_preset_file(char * pathname, preset_t * preset) { return FAILURE; /* Open the file corresponding to pathname */ - if ((fs = fopen(pathname, "r")) == 0) { + if ((fs = utf8_fopen(pathname, "r")) == 0) { if (PRESET_DEBUG) printf("load_preset_file: loading of file %s failed!\n", pathname); return ERROR; } @@ -792,7 +792,7 @@ void savePreset(char * filename) { return; /* Open the file corresponding to pathname */ - if ((fs = fopen(filename, "w+")) == 0) { + if ((fs = utf8_fopen(filename, "w+")) == 0) { if (PRESET_DEBUG) printf("savePreset: failed to create filename \"%s\"!\n", filename); return; } diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c index aad3799036..8d730775cd 100644 --- a/src/video_output/vout_intf.c +++ b/src/video_output/vout_intf.c @@ -39,6 +39,7 @@ #include #include #include +#include "charset.h" #include #include @@ -636,7 +637,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) char *psz_prefix = var_GetString( p_vout, "snapshot-prefix" ); if( !psz_prefix ) psz_prefix = strdup( "vlcsnap-" ); - closedir( path ); + vlc_closedir_wrapper( path ); if( var_GetBool( p_vout, "snapshot-sequential" ) == VLC_TRUE ) { int i_num = var_GetInteger( p_vout, "snapshot-num" ); -- 2.39.5