d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering This file is part of systemd.
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering Copyright 2013 Lennart Poettering
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering systemd is free software; you can redistribute it and/or modify it
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering under the terms of the GNU Lesser General Public License as published by
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering (at your option) any later version.
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering systemd is distributed in the hope that it will be useful, but
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering Lesser General Public License for more details.
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering You should have received a copy of the GNU Lesser General Public License
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
3e348b8a6af4bc46562efa44500fe2fa44320aa1Ronny Chevalier char dn[] = "/var/tmp/test-journal-flush.XXXXXX";
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering unsigned n = 0;
dfd9cf7f0b257d38f5527989dd9315e767fbe41bZbigniew Jędrzejewski-Szmek fn = strappend(dn, "/test.journal");
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering r = journal_file_open(fn, O_CREAT|O_RDWR, 0644, false, false, NULL, NULL, NULL, &new_journal);
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering r = journal_file_move_to_object(f, OBJECT_ENTRY, f->current_offset, &o);
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering r = journal_file_copy_entry(f, new_journal, o, f->current_offset, NULL, NULL, NULL);
d0767ffd08bbb5c069e266710eb0462315e47e6dLennart Poettering if (n > 10000)