On Sat, 16.03.13 18:45, Oleksii Shevchuk ([email protected]) wrote:

> +int journal_file_sync(JournalFile *f) {
> +        if (! (f->writable && f->fd >= 0))
> +                return -1;
> +
> +        if (fdatasync(f->fd))
> +                return -errno;
> +
> +        return 0;
> +}

I'd really prefer if we'd go much further here, and actually
"soft-close" the file, i.e. unmark it as "dirty" in the header, so that
it would be considered "clean" on a hard reset after the syncing...

> +                if (sfsi.ssi_signo == SIGALRM) {

Using signal-based wakeups isn't really that nice. Please use timerfd()
instead. SIGALRM is an awful API and can only have a single owner
really, so we really shouldn't use it unless we really have no other
option. timerfd() is not exclusive, and much nicer, so please use that.


Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to