]> git.sesse.net Git - vlc/commitdiff
OS/2 uses the same file operations as Win32
authorKO Myung-Hun <komh@chollian.net>
Mon, 4 Apr 2011 20:41:09 +0000 (22:41 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Tue, 5 Apr 2011 11:20:01 +0000 (13:20 +0200)
Signed-off-by: Rémi Duraffort <ivoire@videolan.org>
modules/access_output/file.c
modules/video_filter/scene.c
src/config/file.c
src/misc/messages.c
src/modules/cache.c

index f104f59b0dd247200c30453a5f03f0351f108f3b..88fb86bb8f1eb04b6e2a56cfab77372d5df388ee 100644 (file)
@@ -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));
index 577cc85401c4770b63ac9936dd26f5d4613e8bf9..86749936f68cd83bfeea1699397f7d600a05a269 100644 (file)
@@ -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 );
index d7fe4be67796ed6fd477590578a30f65e657017d..bdc29e228794e67a6c61b72a2d0cb4c0fda0b7e3 100644 (file)
@@ -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))
index aa957d4eb775a91d6ad4d3370626a2e61ecc452f..02ab2b387e6e1c479b20134720a97a15cf4e24ed 100644 (file)
@@ -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);
index 76de0b83766b805febe537b75d43e88a923d0707..d908d180f689c12d2112361051242698ab8355a2 100644 (file)
@@ -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