Deleted Added
full compact
file.c (121560) file.c (171816)
1/*
2 * Copyright (c) 1995
3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). 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

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1995
3 * A.R. Gordon (andrew.gordon@net-tel.co.uk). 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

--- 15 unchanged lines hidden (view full) ---

24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/usr.sbin/rpc.statd/file.c 121560 2003-10-26 06:14:10Z peter $
32 * $FreeBSD: head/usr.sbin/rpc.statd/file.c 171816 2007-08-13 15:04:39Z truckman $
33 *
34 */
35
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <stdio.h>
40#include <string.h>

--- 113 unchanged lines hidden (view full) ---

154 errx(1, "unable to open status file %s", filename);
155
156 /* File now open. mmap() it, with a generous size to allow for */
157 /* later growth, where we will extend the file but not re-map it. */
158 status_info = (FileLayout *)
159 mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED, status_fd, 0);
160
161 if (status_info == (FileLayout *) MAP_FAILED)
33 *
34 */
35
36#include <err.h>
37#include <errno.h>
38#include <fcntl.h>
39#include <stdio.h>
40#include <string.h>

--- 113 unchanged lines hidden (view full) ---

154 errx(1, "unable to open status file %s", filename);
155
156 /* File now open. mmap() it, with a generous size to allow for */
157 /* later growth, where we will extend the file but not re-map it. */
158 status_info = (FileLayout *)
159 mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED, status_fd, 0);
160
161 if (status_info == (FileLayout *) MAP_FAILED)
162 warn("unable to mmap() status file");
162 err(1, "unable to mmap() status file");
163
164 status_file_len = lseek(status_fd, 0L, SEEK_END);
165
166 /* If the file was not newly created, validate the contents, and if */
167 /* defective, re-create from scratch. */
168 if (!new_file)
169 {
170 if ((status_file_len < HEADER_LEN) || (status_file_len

--- 161 unchanged lines hidden ---
163
164 status_file_len = lseek(status_fd, 0L, SEEK_END);
165
166 /* If the file was not newly created, validate the contents, and if */
167 /* defective, re-create from scratch. */
168 if (!new_file)
169 {
170 if ((status_file_len < HEADER_LEN) || (status_file_len

--- 161 unchanged lines hidden ---