fifolog_int.c (219094) | fifolog_int.c (219097) |
---|---|
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/lib/fifolog_int.c 219094 2011-02-28 08:59:35Z phk $ | 26 * $FreeBSD: head/usr.sbin/fifolog/lib/fifolog_int.c 219097 2011-02-28 14:48:00Z phk $ |
27 */ 28 29#include <assert.h> 30#include <errno.h> 31#include <fcntl.h> 32#include <stdlib.h> 33#include <string.h> 34#include <unistd.h> --- 16 unchanged lines hidden (view full) --- 51 * The second function is just an error-handling wrapper around the 52 * first which, does the actual work. 53 */ 54 55static const char * 56fifolog_int_open_i(struct fifolog_file *f, const char *fname, int mode) 57{ 58 struct stat st; | 27 */ 28 29#include <assert.h> 30#include <errno.h> 31#include <fcntl.h> 32#include <stdlib.h> 33#include <string.h> 34#include <unistd.h> --- 16 unchanged lines hidden (view full) --- 51 * The second function is just an error-handling wrapper around the 52 * first which, does the actual work. 53 */ 54 55static const char * 56fifolog_int_open_i(struct fifolog_file *f, const char *fname, int mode) 57{ 58 struct stat st; |
59 unsigned u; | 59 ssize_t u; |
60 int i; 61 62 f->fd = open(fname, mode ? O_RDWR : O_RDONLY); 63 if (f->fd < 0) 64 return ("Cannot open"); 65 66 /* Determine initial record size guesstimate */ 67 i = ioctl(f->fd, DIOCGSECTORSIZE, &f->recsize); --- 189 unchanged lines hidden --- | 60 int i; 61 62 f->fd = open(fname, mode ? O_RDWR : O_RDONLY); 63 if (f->fd < 0) 64 return ("Cannot open"); 65 66 /* Determine initial record size guesstimate */ 67 i = ioctl(f->fd, DIOCGSECTORSIZE, &f->recsize); --- 189 unchanged lines hidden --- |