rsyslog/tests/ourtail.c
Rainer Gerhards 6f4e3c4e4c restructered code in perparation for multiple rule set support
... this was long overdue, and I finlly tackeld it. It turned out to
be more complex than I initially thought. The next step now probably is
to actually implement multiple rule sets and the beauty that comes
with them.
2009-06-10 16:49:14 +02:00

46 lines
1.5 KiB
C

/* This is a quick and dirty "tail implementation", one which always
* skips the first line, but nothing else. I have done this to prevent
* the various incompatible options of tail come into my way. One could
* probably work around this by using autoconf magic, but for me it
* was much quicker writing this small C program, which really should
* be portable across all platforms.
*
* Part of the testbench for rsyslog.
*
* Copyright 2009 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of rsyslog.
*
* Rsyslog 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 3 of the License, or
* (at your option) any later version.
*
* Rsyslog is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
*/
#include <stdio.h>
int main(int __attribute__((unused)) argc, char __attribute__((unused)) *argv[])
{
int c;
for(c = getchar() ; c != EOF && c != '\n' ; c = getchar())
/*skip to newline*/;
if(c == '\n')
c = getchar();
for( ; c != EOF ; c = getchar())
putchar(c);
return 0;
}