Merge branch 'maint'
[debian/gnuradio] / gnuradio-core / src / lib / io / gr_file_sink.cc
index 0994fd2ba9516fe79688870e4c4945fe73a6e7e0..aab0158e7ba8bc7ee1b9eafce6045e88ceb3c3be 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2004,2006,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -32,7 +32,7 @@
 gr_file_sink_sptr
 gr_make_file_sink (size_t itemsize, const char *filename)
 {
-  return gr_file_sink_sptr (new gr_file_sink (itemsize, filename));
+  return gnuradio::get_initial_sptr(new gr_file_sink (itemsize, filename));
 }
 
 gr_file_sink::gr_file_sink(size_t itemsize, const char *filename)
@@ -70,5 +70,8 @@ gr_file_sink::work (int noutput_items,
     nwritten += count;
     inbuf += count * d_itemsize;
   }
+  if (d_unbuffered)
+         fflush (d_fp);
+         
   return nwritten;
 }