fifolog_reader.c (179000) | fifolog_reader.c (219027) |
---|---|
1/*- 2 * Copyright (c) 2005-2008 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2005-2008 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c 179000 2008-05-14 23:29:02Z phk $ | 26 * $FreeBSD: head/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c 219027 2011-02-25 09:40:17Z phk $ |
27 */ 28 29#include <stdio.h> 30#include <assert.h> 31#include <unistd.h> 32#include <err.h> 33#include <time.h> 34#include <string.h> --- 116 unchanged lines hidden (view full) --- 151 Usage(); 152 153 fprintf(stderr, "From\t%jd %s", (intmax_t)opt_B, ctime(&opt_B)); 154 fprintf(stderr, "To\t%jd %s", (intmax_t)opt_E, ctime(&opt_E)); 155 if (opt_B >= opt_E) 156 errx(1, "Begin time not before End time"); 157 158 fl = fifolog_reader_open(argv[0]); | 27 */ 28 29#include <stdio.h> 30#include <assert.h> 31#include <unistd.h> 32#include <err.h> 33#include <time.h> 34#include <string.h> --- 116 unchanged lines hidden (view full) --- 151 Usage(); 152 153 fprintf(stderr, "From\t%jd %s", (intmax_t)opt_B, ctime(&opt_B)); 154 fprintf(stderr, "To\t%jd %s", (intmax_t)opt_E, ctime(&opt_E)); 155 if (opt_B >= opt_E) 156 errx(1, "Begin time not before End time"); 157 158 fl = fifolog_reader_open(argv[0]); |
159 | 159 |
160 if (!strcmp(opt_o, "-")) 161 fo = stdout; 162 else { 163 fo = fopen(opt_o, "w"); 164 if (fo == NULL) 165 err(1, "Cannot open: %s", argv[1]); 166 } 167 168 o = fifolog_reader_seek(fl, opt_B); 169 fifolog_reader_process(fl, o, Render, NULL, opt_E); 170 return (0); 171} | 160 if (!strcmp(opt_o, "-")) 161 fo = stdout; 162 else { 163 fo = fopen(opt_o, "w"); 164 if (fo == NULL) 165 err(1, "Cannot open: %s", argv[1]); 166 } 167 168 o = fifolog_reader_seek(fl, opt_B); 169 fifolog_reader_process(fl, o, Render, NULL, opt_E); 170 return (0); 171} |