Oswald Buddenhagen wrote:
> On Sat, Apr 20, 2013 at 12:36:30AM +, Eric Wong wrote:
> > fdatasync only flushes data to disk the kernel knows about,
> > so we must tell the kernel about the data [...] before
> > we fdatasync.
> >
> as it happens, we do:
>
> > > setlinebuf( svars->jfp );
Oops,
On Sat, Apr 20, 2013 at 12:36:30AM +, Eric Wong wrote:
> fdatasync only flushes data to disk the kernel knows about,
> so we must tell the kernel about the data [...] before
> we fdatasync.
>
as it happens, we do:
> > setlinebuf( svars->jfp );
that's also the reason why it works reliably wit
fdatasync only flushes data to disk the kernel knows about,
so we must tell the kernel about the data via fflush before
we fdatasync.
Using an Fflushsync wrapper function should make it easier to
avoid this mistake in the future when we use stdio but need
fdatasync.
---
IMHO, this makes the code