Commit 095ad3e1 authored by KO Myung-Hun's avatar KO Myung-Hun Committed by ivoire
Browse files

OS/2 uses the same file operations as Win32


Signed-off-by: ivoire's avatarRémi Duraffort <ivoire@videolan.org>
parent 462a34d4
......@@ -45,6 +45,8 @@
#if defined( WIN32 ) && !defined( UNDER_CE )
# include <io.h>
# define lseek _lseeki64
#elif defined( __OS2__ )
# include <io.h>
#else
# include <unistd.h>
#endif
......@@ -144,7 +146,7 @@ static int Open( vlc_object_t *p_this )
else
if( !strcmp( p_access->psz_path, "-" ) )
{
#ifdef WIN32
#if defined( WIN32 ) || defined( __OS2__ )
setmode (fileno (stdout), O_BINARY);
#endif
fd = vlc_dup (fileno (stdout));
......
......@@ -319,7 +319,7 @@ static void SavePicture( filter_t *p_filter, picture_t *p_pic )
else
{
/* switch to the final destination */
#if defined (WIN32)
#if defined (WIN32) || defined(__OS2__)
vlc_unlink( psz_filename );
#endif
i_ret = vlc_rename( psz_temp, psz_filename );
......
......@@ -84,7 +84,7 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj )
psz_filename );
}
#if !( defined(WIN32) || defined(__APPLE__) )
#if !( defined(WIN32) || defined(__APPLE__) || defined(__OS2__) )
else if( p_stream == NULL && errno == ENOENT )
{
/* This is the fallback for pre XDG Base Directory
......@@ -622,7 +622,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
clearerr (file);
goto error;
}
#ifndef WIN32
#if !defined( WIN32 ) && !defined( __OS2__ )
#ifdef __APPLE__
fsync (fd); /* Flush from OS */
#else
......@@ -636,7 +636,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
vlc_mutex_unlock (&lock);
#endif
fclose (file);
#ifdef WIN32
#if defined( WIN32 ) || defined( __OS2__ )
/* Windows cannot remove open files nor overwrite existing ones */
vlc_unlink (permanent);
if (vlc_rename (temporary, permanent))
......
......@@ -531,7 +531,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
p_item->psz_msg,
priv->b_color ? GRAY : "" );
#ifdef WIN32
#if defined( WIN32 ) || defined( __OS2__ )
fflush( stderr );
#endif
vlc_restorecancel (canc);
......
......@@ -478,7 +478,7 @@ void CacheSave (vlc_object_t *p_this, const char *dir,
goto out;
}
#ifndef WIN32
#if !defined( WIN32 ) && !defined( __OS2__ )
vlc_rename (tmpname, filename); /* atomically replace old cache */
fclose (file);
#else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment