OSDN Git Service

merge from gnu/gcc-4_7-branch.
[pf3gnuchains/gcc-fork.git] / libgfortran / io / unix.c
index 6cc07f3..8421451 100644 (file)
@@ -1515,23 +1515,6 @@ retry:
   return u;
 }
 
-
-/* Flush dirty data, making sure that OS metadata is updated as
-   well. Note that this is VERY slow on mingw due to committing data
-   to stable storage.  */
-int
-flush_sync (stream * s)
-{
-  if (sflush (s) == -1)
-    return -1;
-#ifdef __MINGW32__
-  if (_commit (((unix_stream *)s)->fd) == -1)
-    return -1;
-#endif
-  return 0;
-}
-
-
 static gfc_unit *
 flush_all_units_1 (gfc_unit *u, int min_unit)
 {
@@ -1548,7 +1531,7 @@ flush_all_units_1 (gfc_unit *u, int min_unit)
          if (__gthread_mutex_trylock (&u->lock))
            return u;
          if (u->s)
-           flush_sync (u->s);
+           sflush (u->s);
          __gthread_mutex_unlock (&u->lock);
        }
       u = u->right;
@@ -1578,7 +1561,7 @@ flush_all_units (void)
 
       if (u->closed == 0)
        {
-         flush_sync (u->s);
+         sflush (u->s);
          __gthread_mutex_lock (&unit_lock);
          __gthread_mutex_unlock (&u->lock);
          (void) predec_waiting_locked (u);