Deleted Added
full compact
defs.c (65264) defs.c (65269)
1/*-
2 * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
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) 1997 Brian Somers <brian@Awfulhak.org>
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/ppp/defs.c 65264 2000-08-30 20:51:13Z brian $
26 * $FreeBSD: head/usr.sbin/ppp/defs.c 65269 2000-08-31 00:45:24Z brian $
27 */
28
29
30#include <sys/types.h>
31#include <netdb.h>
32#include <netinet/in.h>
33#include <arpa/inet.h>
34#include <sys/socket.h>

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

48#include <time.h>
49#endif
50#include <unistd.h>
51
52#include "defs.h"
53
54#define issep(c) ((c) == '\t' || (c) == ' ')
55
27 */
28
29
30#include <sys/types.h>
31#include <netdb.h>
32#include <netinet/in.h>
33#include <arpa/inet.h>
34#include <sys/socket.h>

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

48#include <time.h>
49#endif
50#include <unistd.h>
51
52#include "defs.h"
53
54#define issep(c) ((c) == '\t' || (c) == ' ')
55
56#if defined(__NetBSD__) || __FreeBSD__ < 3
56void
57randinit()
58{
57void
58randinit()
59{
59#if defined(__OpenBSD__) || __FreeBSD__ >= 3
60#if defined(__FreeBSD__)
60 static int initdone; /* srandomdev() call is only required once */
61
62 if (!initdone) {
63 initdone = 1;
64 srandomdev();
65 }
66#else
67 srandom((time(NULL)^getpid())+random());
68#endif
69}
61 static int initdone; /* srandomdev() call is only required once */
62
63 if (!initdone) {
64 initdone = 1;
65 srandomdev();
66 }
67#else
68 srandom((time(NULL)^getpid())+random());
69#endif
70}
71#endif
70
71ssize_t
72fullread(int fd, void *v, size_t n)
73{
74 size_t got, total;
75
76 for (total = 0; total < n; total += got)
77 switch ((got = read(fd, (char *)v + total, n - total))) {

--- 304 unchanged lines hidden ---
72
73ssize_t
74fullread(int fd, void *v, size_t n)
75{
76 size_t got, total;
77
78 for (total = 0; total < n; total += got)
79 switch ((got = read(fd, (char *)v + total, n - total))) {

--- 304 unchanged lines hidden ---