Commit 8f2e1e57 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use vlc_close()

parent 582355f9
...@@ -140,7 +140,9 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const char *psz_fmt, ...@@ -140,7 +140,9 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const char *psz_fmt,
# define SHUT_WR 1 # define SHUT_WR 1
# define SHUT_RDWR 2 # define SHUT_RDWR 2
# endif # endif
# define net_Close( fd ) (void)close (fd)
VLC_API int vlc_close(int);
# define net_Close( fd ) (void)vlc_close (fd)
#endif #endif
/* Portable network names/addresses resolution layer */ /* Portable network names/addresses resolution layer */
......
...@@ -610,7 +610,7 @@ static int probeFile(const char *psz_name) ...@@ -610,7 +610,7 @@ static int probeFile(const char *psz_name)
ret = VLC_SUCCESS; ret = VLC_SUCCESS;
bailout: bailout:
close(fd); vlc_close(fd);
return ret; return ret;
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_charset.h> #include <vlc_charset.h>
#include <vlc_fs.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
...@@ -2625,6 +2626,6 @@ void en50221_End( cam_t * p_cam ) ...@@ -2625,6 +2626,6 @@ void en50221_End( cam_t * p_cam )
} }
} }
close( p_cam->fd ); vlc_close( p_cam->fd );
free( p_cam ); free( p_cam );
} }
...@@ -215,7 +215,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj) ...@@ -215,7 +215,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj)
{ {
msg_Err (obj, "cannot access demultiplexer: %s", msg_Err (obj, "cannot access demultiplexer: %s",
vlc_strerror_c(errno)); vlc_strerror_c(errno));
close (d->dir); vlc_close (d->dir);
free (d); free (d);
return NULL; return NULL;
} }
...@@ -249,7 +249,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj) ...@@ -249,7 +249,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj)
if (d->demux == -1) if (d->demux == -1)
{ {
msg_Err (obj, "cannot access DVR: %s", vlc_strerror_c(errno)); msg_Err (obj, "cannot access DVR: %s", vlc_strerror_c(errno));
close (d->dir); vlc_close (d->dir);
free (d); free (d);
return NULL; return NULL;
} }
...@@ -261,7 +261,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj) ...@@ -261,7 +261,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj)
{ {
d->cam = en50221_Init (obj, ca); d->cam = en50221_Init (obj, ca);
if (d->cam == NULL) if (d->cam == NULL)
close (ca); vlc_close (ca);
} }
else else
msg_Dbg (obj, "conditional access module not available: %s", msg_Dbg (obj, "conditional access module not available: %s",
...@@ -280,15 +280,15 @@ void dvb_close (dvb_device_t *d) ...@@ -280,15 +280,15 @@ void dvb_close (dvb_device_t *d)
{ {
for (size_t i = 0; i < MAX_PIDS; i++) for (size_t i = 0; i < MAX_PIDS; i++)
if (d->pids[i].fd != -1) if (d->pids[i].fd != -1)
close (d->pids[i].fd); vlc_close (d->pids[i].fd);
} }
#endif #endif
if (d->cam != NULL) if (d->cam != NULL)
en50221_End (d->cam); en50221_End (d->cam);
if (d->frontend != -1) if (d->frontend != -1)
close (d->frontend); vlc_close (d->frontend);
close (d->demux); vlc_close (d->demux);
close (d->dir); vlc_close (d->dir);
free (d); free (d);
} }
...@@ -406,7 +406,7 @@ int dvb_add_pid (dvb_device_t *d, uint16_t pid) ...@@ -406,7 +406,7 @@ int dvb_add_pid (dvb_device_t *d, uint16_t pid)
param.flags = DMX_IMMEDIATE_START; param.flags = DMX_IMMEDIATE_START;
if (ioctl (fd, DMX_SET_PES_FILTER, &param) < 0) if (ioctl (fd, DMX_SET_PES_FILTER, &param) < 0)
{ {
close (fd); vlc_close (fd);
goto error; goto error;
} }
d->pids[i].fd = fd; d->pids[i].fd = fd;
...@@ -433,7 +433,7 @@ void dvb_remove_pid (dvb_device_t *d, uint16_t pid) ...@@ -433,7 +433,7 @@ void dvb_remove_pid (dvb_device_t *d, uint16_t pid)
{ {
if (d->pids[i].pid == pid) if (d->pids[i].pid == pid)
{ {
close (d->pids[i].fd); vlc_close (d->pids[i].fd);
d->pids[i].pid = d->pids[i].fd = -1; d->pids[i].pid = d->pids[i].fd = -1;
return; return;
} }
......
...@@ -110,7 +110,7 @@ int FrontendOpen( access_t *p_access ) ...@@ -110,7 +110,7 @@ int FrontendOpen( access_t *p_access )
if( FrontendInfo( p_access ) < 0 ) if( FrontendInfo( p_access ) < 0 )
{ {
close( p_sys->i_frontend_handle ); vlc_close( p_sys->i_frontend_handle );
free( p_frontend ); free( p_frontend );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -165,7 +165,7 @@ int FrontendOpen( access_t *p_access ) ...@@ -165,7 +165,7 @@ int FrontendOpen( access_t *p_access )
{ {
msg_Err( p_access, "requested type %s not supported by %s tuner", msg_Err( p_access, "requested type %s not supported by %s tuner",
psz_expected, psz_real ); psz_expected, psz_real );
close( p_sys->i_frontend_handle ); vlc_close( p_sys->i_frontend_handle );
free( p_frontend ); free( p_frontend );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -202,7 +202,7 @@ void FrontendClose( access_t *p_access ) ...@@ -202,7 +202,7 @@ void FrontendClose( access_t *p_access )
if( p_sys->p_frontend ) if( p_sys->p_frontend )
{ {
close( p_sys->i_frontend_handle ); vlc_close( p_sys->i_frontend_handle );
free( p_sys->p_frontend ); free( p_sys->p_frontend );
p_sys->p_frontend = NULL; p_sys->p_frontend = NULL;
...@@ -1216,7 +1216,7 @@ int DMXUnsetFilter( access_t * p_access, int i_fd ) ...@@ -1216,7 +1216,7 @@ int DMXUnsetFilter( access_t * p_access, int i_fd )
} }
msg_Dbg( p_access, "DMXUnsetFilter: closing demux %d", i_fd ); msg_Dbg( p_access, "DMXUnsetFilter: closing demux %d", i_fd );
close( i_fd ); vlc_close( i_fd );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -1268,5 +1268,5 @@ void DVRClose( access_t * p_access ) ...@@ -1268,5 +1268,5 @@ void DVRClose( access_t * p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
close( p_sys->i_handle ); vlc_close( p_sys->i_handle );
} }
...@@ -1608,6 +1608,6 @@ static int ProbeDVD( const char *psz_name ) ...@@ -1608,6 +1608,6 @@ static int ProbeDVD( const char *psz_name )
&& GetWLE( &anchor ) == 2 ) && GetWLE( &anchor ) == 2 )
ret = VLC_SUCCESS; /* Found a potential anchor */ ret = VLC_SUCCESS; /* Found a potential anchor */
bailout: bailout:
close( fd ); vlc_close( fd );
return ret; return ret;
} }
...@@ -180,7 +180,7 @@ static int Open(vlc_object_t *p_this) ...@@ -180,7 +180,7 @@ static int Open(vlc_object_t *p_this)
if (bind(publicSock, (struct sockaddr *)&publicAddr, sizeof(struct sockaddr_un)) == -1) { if (bind(publicSock, (struct sockaddr *)&publicAddr, sizeof(struct sockaddr_un)) == -1) {
msg_Err(p_access, "bind local socket failed (errno=%d)", errno); msg_Err(p_access, "bind local socket failed (errno=%d)", errno);
close(publicSock); vlc_close(publicSock);
free(p_sys); free(p_sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -188,7 +188,7 @@ static int Open(vlc_object_t *p_this) ...@@ -188,7 +188,7 @@ static int Open(vlc_object_t *p_this)
/* we are not expecting more than one connection */ /* we are not expecting more than one connection */
if (listen(publicSock, 1) == -1) { if (listen(publicSock, 1) == -1) {
msg_Err(p_access, "cannot accept connection (errno=%d)", errno); msg_Err(p_access, "cannot accept connection (errno=%d)", errno);
close(publicSock); vlc_close(publicSock);
free(p_sys); free(p_sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} else { } else {
...@@ -207,7 +207,7 @@ static int Open(vlc_object_t *p_this) ...@@ -207,7 +207,7 @@ static int Open(vlc_object_t *p_this)
peerSock = accept(publicSock, (struct sockaddr *)&peerAddr, &peerSockLen); peerSock = accept(publicSock, (struct sockaddr *)&peerAddr, &peerSockLen);
if (peerSock == -1) { if (peerSock == -1) {
msg_Err(p_access, "cannot wait for connection (errno=%d)", errno); msg_Err(p_access, "cannot wait for connection (errno=%d)", errno);
close(publicSock); vlc_close(publicSock);
free(p_sys); free(p_sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -217,7 +217,7 @@ static int Open(vlc_object_t *p_this) ...@@ -217,7 +217,7 @@ static int Open(vlc_object_t *p_this)
p_sys->eyetvSock = peerSock; p_sys->eyetvSock = peerSock;
/* remove public access */ /* remove public access */
close(publicSock); vlc_close(publicSock);
unlink(publicAddr.sun_path); unlink(publicAddr.sun_path);
} }
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -241,7 +241,7 @@ static void Close(vlc_object_t *p_this) ...@@ -241,7 +241,7 @@ static void Close(vlc_object_t *p_this)
TRUE); TRUE);
msg_Dbg(p_access, "plugin notified"); msg_Dbg(p_access, "plugin notified");
close(p_sys->eyetvSock); vlc_close(p_sys->eyetvSock);
msg_Dbg(p_access, "msg port closed and freed"); msg_Dbg(p_access, "msg port closed and freed");
free(p_sys); free(p_sys);
......
...@@ -249,7 +249,7 @@ int FileOpen( vlc_object_t *p_this ) ...@@ -249,7 +249,7 @@ int FileOpen( vlc_object_t *p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
close (fd); vlc_close (fd);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -268,7 +268,7 @@ void FileClose (vlc_object_t * p_this) ...@@ -268,7 +268,7 @@ void FileClose (vlc_object_t * p_this)
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
close (p_sys->fd); vlc_close (p_sys->fd);
free (p_sys); free (p_sys);
} }
......
...@@ -76,7 +76,7 @@ static void conn_destroy(void) ...@@ -76,7 +76,7 @@ static void conn_destroy(void)
{ {
conn_shutdown(SHUT_WR); conn_shutdown(SHUT_WR);
vlc_http_conn_release(conn); vlc_http_conn_release(conn);
close(external_fd); vlc_close(external_fd);
} }
static struct vlc_http_stream *stream_open(void) static struct vlc_http_stream *stream_open(void)
......
...@@ -113,7 +113,7 @@ static void conn_destroy(void) ...@@ -113,7 +113,7 @@ static void conn_destroy(void)
{ {
shutdown(external_fd, SHUT_WR); shutdown(external_fd, SHUT_WR);
vlc_http_conn_release(conn); vlc_http_conn_release(conn);
close(external_fd); vlc_close(external_fd);
} }
static struct vlc_http_stream *stream_open(void) static struct vlc_http_stream *stream_open(void)
......
...@@ -98,7 +98,7 @@ static void *proxy_thread(void *data) ...@@ -98,7 +98,7 @@ static void *proxy_thread(void *data)
int canc = vlc_savecancel(); int canc = vlc_savecancel();
proxy_client_process(cfd); proxy_client_process(cfd);
close(cfd); vlc_close(cfd);
connection_count++; connection_count++;
vlc_restorecancel(canc); vlc_restorecancel(canc);
} }
...@@ -123,7 +123,7 @@ static int server_socket(unsigned *port) ...@@ -123,7 +123,7 @@ static int server_socket(unsigned *port)
if (bind(fd, (struct sockaddr *)&addr, addrlen) if (bind(fd, (struct sockaddr *)&addr, addrlen)
|| getsockname(fd, (struct sockaddr *)&addr, &addrlen)) || getsockname(fd, (struct sockaddr *)&addr, &addrlen))
{ {
close(fd); vlc_close(fd);
return -1; return -1;
} }
...@@ -157,7 +157,7 @@ int main(void) ...@@ -157,7 +157,7 @@ int main(void)
if (listen(lfd, 255)) if (listen(lfd, 255))
{ {
close(lfd); vlc_close(lfd);
return 77; return 77;
} }
...@@ -173,5 +173,5 @@ int main(void) ...@@ -173,5 +173,5 @@ int main(void)
vlc_join(th, NULL); vlc_join(th, NULL);
assert(connection_count > 0); assert(connection_count > 0);
free(url); free(url);
close(lfd); vlc_close(lfd);
} }
...@@ -253,7 +253,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -253,7 +253,7 @@ static int Open( vlc_object_t *p_this )
if( pthread_create( &p_sys->thread, NULL, Demux, p_demux ) ) if( pthread_create( &p_sys->thread, NULL, Demux, p_demux ) )
{ {
close( p_sys->evfd ); vlc_close( p_sys->evfd );
goto error; goto error;
} }
...@@ -275,7 +275,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -275,7 +275,7 @@ static void Close( vlc_object_t *p_this )
write( p_sys->evfd, &(uint64_t){ 1 }, sizeof (uint64_t)); write( p_sys->evfd, &(uint64_t){ 1 }, sizeof (uint64_t));
pthread_join( p_sys->thread, NULL ); pthread_join( p_sys->thread, NULL );
close( p_sys->evfd ); vlc_close( p_sys->evfd );
free( p_sys ); free( p_sys );
} }
...@@ -667,7 +667,7 @@ static ssize_t WriteULSysfs( const char *psz_fmt, unsigned int i_link, ...@@ -667,7 +667,7 @@ static ssize_t WriteULSysfs( const char *psz_fmt, unsigned int i_link,
return i_fd; return i_fd;
i_ret = write( i_fd, psz_data, strlen(psz_data) + 1 ); i_ret = write( i_fd, psz_data, strlen(psz_data) + 1 );
close( i_fd ); vlc_close( i_fd );
return i_ret; return i_ret;
} }
...@@ -727,7 +727,7 @@ static int InitCapture( demux_t *p_demux ) ...@@ -727,7 +727,7 @@ static int InitCapture( demux_t *p_demux )
if( pfd[1].revents ) if( pfd[1].revents )
{ {
close( p_sys->i_vfd ); vlc_close( p_sys->i_vfd );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
} }
...@@ -737,10 +737,10 @@ static int InitCapture( demux_t *p_demux ) ...@@ -737,10 +737,10 @@ static int InitCapture( demux_t *p_demux )
{ {
msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETVIDSTATUS: %s", msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETVIDSTATUS: %s",
vlc_strerror_c(errno) ); vlc_strerror_c(errno) );
close( p_sys->i_vfd ); vlc_close( p_sys->i_vfd );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
close( p_sys->i_vfd ); vlc_close( p_sys->i_vfd );
if ( InitVideo( p_demux ) != VLC_SUCCESS ) if ( InitVideo( p_demux ) != VLC_SUCCESS )
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -789,7 +789,7 @@ static int InitCapture( demux_t *p_demux ) ...@@ -789,7 +789,7 @@ static int InitCapture( demux_t *p_demux )
msg_Err( p_demux, "unknown sample rate %u", i_rate ); msg_Err( p_demux, "unknown sample rate %u", i_rate );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
close( p_sys->i_afd ); vlc_close( p_sys->i_afd );
if ( InitAudio( p_demux ) != VLC_SUCCESS ) if ( InitAudio( p_demux ) != VLC_SUCCESS )
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -925,7 +925,7 @@ static void CloseCapture( demux_t *p_demux ) ...@@ -925,7 +925,7 @@ static void CloseCapture( demux_t *p_demux )
munmap( p_sys->pp_vbuffers[i], p_sys->i_vbuffer_size ); munmap( p_sys->pp_vbuffers[i], p_sys->i_vbuffer_size );
free( p_sys->pp_vbuffers ); free( p_sys->pp_vbuffers );
#endif #endif
close( p_sys->i_vfd ); vlc_close( p_sys->i_vfd );
if ( p_sys->i_max_channel != -1 ) if ( p_sys->i_max_channel != -1 )
{ {
#ifdef HAVE_MMAP_SDIAUDIO #ifdef HAVE_MMAP_SDIAUDIO
...@@ -933,7 +933,7 @@ static void CloseCapture( demux_t *p_demux ) ...@@ -933,7 +933,7 @@ static void CloseCapture( demux_t *p_demux )
munmap( p_sys->pp_abuffers[i], p_sys->i_abuffer_size ); munmap( p_sys->pp_abuffers[i], p_sys->i_abuffer_size );
free( p_sys->pp_abuffers ); free( p_sys->pp_abuffers );
#endif #endif
close( p_sys->i_afd ); vlc_close( p_sys->i_afd );
} }
} }
......
...@@ -1765,7 +1765,7 @@ static void CloseCapture( demux_t *p_demux ) ...@@ -1765,7 +1765,7 @@ static void CloseCapture( demux_t *p_demux )
StopDecode( p_demux ); StopDecode( p_demux );
for ( unsigned int i = 0; i < p_sys->i_buffers; i++ ) for ( unsigned int i = 0; i < p_sys->i_buffers; i++ )
munmap( p_sys->pp_buffers[i], p_sys->i_buffer_size ); munmap( p_sys->pp_buffers[i], p_sys->i_buffer_size );
close( p_sys->i_fd ); vlc_close( p_sys->i_fd );
free( p_sys->pp_buffers ); free( p_sys->pp_buffers );
} }
......
...@@ -164,7 +164,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -164,7 +164,7 @@ static void Close( vlc_object_t * p_this )
access_t *p_access = ( access_t* )p_this; access_t *p_access = ( access_t* )p_this;
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
close ( p_sys->fd ); vlc_close ( p_sys->fd );
if( vlc_unlink( p_access->psz_filepath ) != 0 ) if( vlc_unlink( p_access->psz_filepath ) != 0 )
msg_Err( p_access, "Error deleting file %s, %s", msg_Err( p_access, "Error deleting file %s, %s",
p_access->psz_filepath, vlc_strerror_c(errno) ); p_access->psz_filepath, vlc_strerror_c(errno) );
......
...@@ -192,7 +192,8 @@ static void DemuxClose( vlc_object_t *p_this ) ...@@ -192,7 +192,8 @@ static void DemuxClose( vlc_object_t *p_this )
demux_t *p_demux = (demux_t *)p_this; demux_t *p_demux = (demux_t *)p_this;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
if( p_sys->i_fd >= 0 ) close( p_sys->i_fd ); if( p_sys->i_fd >= 0 )
vlc_close( p_sys->i_fd );
if( p_sys->p_block ) block_Release( p_sys->p_block ); if( p_sys->p_block ) block_Release( p_sys->p_block );
free( p_sys ); free( p_sys );
...@@ -376,7 +377,8 @@ static int OpenAudioDevOss( demux_t *p_demux ) ...@@ -376,7 +377,8 @@ static int OpenAudioDevOss( demux_t *p_demux )
adev_fail: adev_fail:
if( i_fd >= 0 ) close( i_fd ); if( i_fd >= 0 )
vlc_close( i_fd );
return -1; return -1;
} }
...@@ -432,11 +434,13 @@ static bool ProbeAudioDevOss( demux_t *p_demux, const char *psz_device ) ...@@ -432,11 +434,13 @@ static bool ProbeAudioDevOss( demux_t *p_demux, const char *psz_device )
goto open_failed; goto open_failed;
} }
if( i_fd >= 0 ) close( i_fd ); if( i_fd >= 0 )
vlc_close( i_fd );
return true; return true;
open_failed: open_failed:
if( i_fd >= 0 ) close( i_fd ); if( i_fd >= 0 )
vöc_close( i_fd );
return false; return false;
} }
...@@ -219,7 +219,7 @@ static block_t *Shoot(demux_t *demux) ...@@ -219,7 +219,7 @@ static block_t *Shoot(demux_t *demux)
} }
out: out:
close(fd); vlc_close(fd);
return block; return block;
} }
......
...@@ -341,7 +341,7 @@ static void DemuxFile (void *data) ...@@ -341,7 +341,7 @@ static void DemuxFile (void *data)
static void CloseFile (demux_sys_t *sys) static void CloseFile (demux_sys_t *sys)
{ {
close (sys->fd); vlc_close (sys->fd);
} }
#ifdef HAVE_SYS_SHM_H #ifdef HAVE_SYS_SHM_H
......
...@@ -72,7 +72,7 @@ vlc_v4l2_vbi_t *OpenVBI (demux_t *demux, const char *psz_device) ...@@ -72,7 +72,7 @@ vlc_v4l2_vbi_t *OpenVBI (demux_t *demux, const char *psz_device)
{ {
msg_Err (demux, "cannot capture VBI data: %s", errstr); msg_Err (demux, "cannot capture VBI data: %s", errstr);
free (errstr); free (errstr);
close (rawfd); vlc_close (rawfd);
goto err; goto err;
} }
...@@ -155,7 +155,7 @@ void GrabVBI (demux_t *p_demux, vlc_v4l2_vbi_t *vbi) ...@@ -155,7 +155,7 @@ void GrabVBI (demux_t *p_demux, vlc_v4l2_vbi_t *vbi)
void CloseVBI (vlc_v4l2_vbi_t *vbi) void CloseVBI (vlc_v4l2_vbi_t *vbi)
{ {
close (vbi_capture_fd (vbi->cap)); vlc_close (vbi_capture_fd (vbi->cap));
vbi_capture_delete (vbi->cap); vbi_capture_delete (vbi->cap);
free (vbi); free (vbi);
} }
......
...@@ -248,7 +248,7 @@ void ioctl_Close( vlc_object_t * p_this, vcddev_t *p_vcddev ) ...@@ -248,7 +248,7 @@ void ioctl_Close( vlc_object_t * p_this, vcddev_t *p_vcddev )
DosClose( p_vcddev->hcd ); DosClose( p_vcddev->hcd );
#else #else
if( p_vcddev->i_device_handle != -1 ) if( p_vcddev->i_device_handle != -1 )
close( p_vcddev->i_device_handle ); vlc_close( p_vcddev->i_device_handle );
#endif #endif
free( p_vcddev ); free( p_vcddev );
} }
...@@ -919,7 +919,7 @@ static void CloseVCDImage( vlc_object_t * p_this, vcddev_t *p_vcddev ) ...@@ -919,7 +919,7 @@ static void CloseVCDImage( vlc_object_t * p_this, vcddev_t *p_vcddev )
{ {
VLC_UNUSED( p_this ); VLC_UNUSED( p_this );
if( p_vcddev->i_vcdimage_handle != -1 ) if( p_vcddev->i_vcdimage_handle != -1 )
close( p_vcddev->i_vcdimage_handle ); vlc_close( p_vcddev->i_vcdimage_handle );
else else
return; return;
......
...@@ -215,7 +215,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -215,7 +215,7 @@ static void Close( vlc_object_t * p_this )
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
if( p_sys->fd != -1 ) if( p_sys->fd != -1 )
close( p_sys->fd ); vlc_close( p_sys->fd );
ARRAY_RESET( p_sys->file_sizes ); ARRAY_RESET( p_sys->file_sizes );
if( p_sys->p_meta ) if( p_sys->p_meta )
...@@ -504,7 +504,7 @@ static bool SwitchFile( access_t *p_access, unsigned i_file ) ...@@ -504,7 +504,7 @@ static bool SwitchFile( access_t *p_access, unsigned i_file )
/* close old file */ /* close old file */
if( p_sys->fd != -1 ) if( p_sys->fd != -1 )
{ {
close( p_sys->fd ); vlc_close( p_sys->fd );
p_sys->fd = -1; p_sys->fd = -1;
} }
...@@ -545,7 +545,7 @@ error: ...@@ -545,7 +545,7 @@ error:
" open the file \"%s\" (%s)."), psz_path, vlc_strerror(errno) ); " open the file \"%s\" (%s)."), psz_path, vlc_strerror(errno) );
if( p_sys->fd != -1 ) if( p_sys->fd != -1 )
{ {
close( p_sys->fd ); vlc_close( p_sys->fd );
p_sys->fd = -1; p_sys->fd = -1;
} }
free( psz_path ); free( psz_path );
......
...@@ -334,7 +334,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -334,7 +334,7 @@ static int Open( vlc_object_t *p_this )
if (fstat (fd, &st)) if (fstat (fd, &st))
{ {
msg_Err (p_access, "write error: %s", vlc_strerror_c(errno)); msg_Err (p_access, "write error: %s", vlc_strerror_c(errno));
close (fd); vlc_close (fd);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -374,7 +374,7 @@ static void Close( vlc_object_t * p_this ) ...@@ -374,7 +374,7 @@ static void Close( vlc_object_t * p_this )
{ {