aboutsummaryrefslogtreecommitdiff
path: root/mp3write~.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2013-01-17 23:15:09 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:23:30 +0200
commit6bf58497fe25026cb7adcdf1a408f24c8ba955e5 (patch)
tree7efefc8281acb05d45b2bb9ffaec674deb4246a2 /mp3write~.c
parent3597f35314d4d5f1974c9236dcc427bca5adab7e (diff)
replace POSIX fopen() with Pd's new sys_fopen() to get cross-platform unicode filename support (Pd-extended 0.43.4/Pd-vanilla 0.44)
svn path=/trunk/externals/unauthorized/; revision=16902
Diffstat (limited to 'mp3write~.c')
-rw-r--r--mp3write~.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mp3write~.c b/mp3write~.c
index 202d5ab..0ed6845 100644
--- a/mp3write~.c
+++ b/mp3write~.c
@@ -418,11 +418,7 @@ static void mp3write_open(t_mp3write *x, t_symbol *sfile)
/* closing previous file descriptor */
if ( x->x_fd > 0 )
{
-#ifdef _WIN32
- if(_close(x->x_fd) < 0 )
-#else
- if(close(x->x_fd) < 0)
-#endif
+ if(sys_close(x->x_fd) < 0)
{
perror( "mp3write~ : closing file" );
}
@@ -433,11 +429,13 @@ static void mp3write_open(t_mp3write *x, t_symbol *sfile)
x->x_recflag = 0;
}
+
#ifdef _WIN32
- if ( ( x->x_fd = _open( sfile->s_name, x->x_file_open_mode, _S_IREAD|_S_IWRITE) ) < 0 )
+ int mode = _S_IREAD|_S_IWRITE;
#else
- if ( ( x->x_fd = open( sfile->s_name, x->x_file_open_mode, S_IRWXU|S_IRWXG|S_IRWXO ) ) < 0 )
+ int mode = S_IRWXU|S_IRWXG|S_IRWXO;
#endif
+ if ( ( x->x_fd = sys_open( sfile->s_name, x->x_file_open_mode, mode) ) < 0 )
{
error( "mp3write~ : cannot open >%s<", sfile->s_name);
x->x_fd=-1;