Deleted Added
full compact
misc.c (216370) misc.c (251565)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Edward Sze-Tyan Wang.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

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
33#include <sys/cdefs.h>
34
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Edward Sze-Tyan Wang.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

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
33#include <sys/cdefs.h>
34
35__FBSDID("$FreeBSD: head/usr.bin/tail/misc.c 216370 2010-12-11 08:32:16Z joel $");
35__FBSDID("$FreeBSD: head/usr.bin/tail/misc.c 251565 2013-06-09 08:06:26Z jh $");
36
37#ifndef lint
38static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
39#endif
40
41#include <sys/types.h>
42#include <sys/stat.h>
43#include <sys/mman.h>

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

108 if (mip->maplen <= 0)
109 abort();
110 if ((mip->start = mmap(NULL, mip->maplen, PROT_READ, MAP_SHARED,
111 mip->fd, mip->mapoff)) == MAP_FAILED)
112 return (1);
113
114 return (0);
115}
36
37#ifndef lint
38static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
39#endif
40
41#include <sys/types.h>
42#include <sys/stat.h>
43#include <sys/mman.h>

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

108 if (mip->maplen <= 0)
109 abort();
110 if ((mip->start = mmap(NULL, mip->maplen, PROT_READ, MAP_SHARED,
111 mip->fd, mip->mapoff)) == MAP_FAILED)
112 return (1);
113
114 return (0);
115}
116
117/*
118 * Print the file name without stdio buffering.
119 */
120void
121printfn(const char *fn, int print_nl)
122{
123
124 if (print_nl)
125 WR("\n", 1);
126 WR("==> ", 4);
127 WR(fn, strlen(fn));
128 WR(" <==\n", 5);
129}