summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-01-08 11:16:48 +1100
committerDamien Miller <djm@mindrot.org>2003-01-08 11:16:48 +1100
commit13dd03a0e2605f0ec2da811aa814a58bc2dd9a3d (patch)
tree16312c22195da192458f6e9c8e9b2def232ad2dc
parentbc9b7c41e2339cc5158357213dad9f238612705b (diff)
- (djm) Sync openbsd-compat/ with OpenBSD -current
-rw-r--r--ChangeLog5
-rw-r--r--openbsd-compat/getcwd.c4
-rw-r--r--openbsd-compat/getopt.c5
-rw-r--r--openbsd-compat/setenv.c5
-rw-r--r--openbsd-compat/sys-tree.h8
5 files changed, 18 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 2441fdfa9..0e00a6c9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
120030108
2 - (djm) Sync openbsd-compat/ with OpenBSD -current
3
120030107 420030107
2 - (djm) Bug #401: Work around Linux breakage with IPv6 mapped addresses. 5 - (djm) Bug #401: Work around Linux breakage with IPv6 mapped addresses.
3 Based on fix from yoshfuji@linux-ipv6.org 6 Based on fix from yoshfuji@linux-ipv6.org
@@ -942,4 +945,4 @@
942 save auth method before monitor_reset_key_state(); bugzilla bug #284; 945 save auth method before monitor_reset_key_state(); bugzilla bug #284;
943 ok provos@ 946 ok provos@
944 947
945$Id: ChangeLog,v 1.2548 2003/01/07 12:55:59 djm Exp $ 948$Id: ChangeLog,v 1.2549 2003/01/08 00:16:48 djm Exp $
diff --git a/openbsd-compat/getcwd.c b/openbsd-compat/getcwd.c
index 6fd8543a5..f4b98e824 100644
--- a/openbsd-compat/getcwd.c
+++ b/openbsd-compat/getcwd.c
@@ -29,7 +29,7 @@
29#if !defined(HAVE_GETCWD) 29#if !defined(HAVE_GETCWD)
30 30
31#if defined(LIBC_SCCS) && !defined(lint) 31#if defined(LIBC_SCCS) && !defined(lint)
32static char rcsid[] = "$OpenBSD: getcwd.c,v 1.6 2000/07/19 15:25:13 deraadt Exp $"; 32static char rcsid[] = "$OpenBSD: getcwd.c,v 1.7 2002/11/24 01:52:27 cloder Exp $";
33#endif /* LIBC_SCCS and not lint */ 33#endif /* LIBC_SCCS and not lint */
34 34
35#include <sys/param.h> 35#include <sys/param.h>
@@ -127,7 +127,7 @@ getcwd(char *pt,size_t size)
127 /* 127 /*
128 * Build pointer to the parent directory, allocating memory 128 * Build pointer to the parent directory, allocating memory
129 * as necessary. Max length is 3 for "../", the largest 129 * as necessary. Max length is 3 for "../", the largest
130 * possible component name, plus a trailing NULL. 130 * possible component name, plus a trailing NUL.
131 */ 131 */
132 if (bup + 3 + MAXNAMLEN + 1 >= eup) { 132 if (bup + 3 + MAXNAMLEN + 1 >= eup) {
133 char *nup; 133 char *nup;
diff --git a/openbsd-compat/getopt.c b/openbsd-compat/getopt.c
index 4a5cfe5f0..a3fe807ee 100644
--- a/openbsd-compat/getopt.c
+++ b/openbsd-compat/getopt.c
@@ -35,7 +35,7 @@
35#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET) 35#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38static char *rcsid = "$OpenBSD: getopt.c,v 1.2 1996/08/19 08:33:32 tholo Exp $"; 38static char *rcsid = "$OpenBSD: getopt.c,v 1.4 2002/12/08 22:57:14 millert Exp $";
39#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
40 40
41#include <stdio.h> 41#include <stdio.h>
@@ -66,6 +66,9 @@ BSDgetopt(nargc, nargv, ostr)
66 static char *place = EMSG; /* option letter processing */ 66 static char *place = EMSG; /* option letter processing */
67 char *oli; /* option letter list index */ 67 char *oli; /* option letter list index */
68 68
69 if (ostr == NULL)
70 return (-1);
71
69 if (BSDoptreset || !*place) { /* update scanning pointer */ 72 if (BSDoptreset || !*place) { /* update scanning pointer */
70 BSDoptreset = 0; 73 BSDoptreset = 0;
71 if (BSDoptind >= nargc || *(place = nargv[BSDoptind]) != '-') { 74 if (BSDoptind >= nargc || *(place = nargv[BSDoptind]) != '-') {
diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c
index 1dff15c73..e5c5de62e 100644
--- a/openbsd-compat/setenv.c
+++ b/openbsd-compat/setenv.c
@@ -35,12 +35,14 @@
35#ifndef HAVE_SETENV 35#ifndef HAVE_SETENV
36 36
37#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
38static char *rcsid = "$OpenBSD: setenv.c,v 1.4 2001/07/09 06:57:45 deraadt Exp $"; 38static char *rcsid = "$OpenBSD: setenv.c,v 1.5 2002/12/10 22:44:13 mickey Exp $";
39#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
40 40
41#include <stdlib.h> 41#include <stdlib.h>
42#include <string.h> 42#include <string.h>
43 43
44char *__findenv(const char *name, int *offset);
45
44/* 46/*
45 * __findenv -- 47 * __findenv --
46 * Returns pointer to value associated with name, if any, else NULL. 48 * Returns pointer to value associated with name, if any, else NULL.
@@ -92,7 +94,6 @@ setenv(name, value, rewrite)
92 static int alloced; /* if allocated space before */ 94 static int alloced; /* if allocated space before */
93 register char *C; 95 register char *C;
94 int l_value, offset; 96 int l_value, offset;
95 char *__findenv();
96 97
97 if (*value == '=') /* no `=' in value */ 98 if (*value == '=') /* no `=' in value */
98 ++value; 99 ++value;
diff --git a/openbsd-compat/sys-tree.h b/openbsd-compat/sys-tree.h
index 0a58710c9..927ca04cd 100644
--- a/openbsd-compat/sys-tree.h
+++ b/openbsd-compat/sys-tree.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tree.h,v 1.6 2002/06/11 22:09:52 provos Exp $ */ 1/* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * All rights reserved. 4 * All rights reserved.
@@ -343,12 +343,13 @@ struct { \
343 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ 343 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
344 else \ 344 else \
345 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ 345 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
346 RB_AUGMENT(RB_PARENT(elm, field)); \
347 } else \ 346 } else \
348 (head)->rbh_root = (tmp); \ 347 (head)->rbh_root = (tmp); \
349 RB_LEFT(tmp, field) = (elm); \ 348 RB_LEFT(tmp, field) = (elm); \
350 RB_PARENT(elm, field) = (tmp); \ 349 RB_PARENT(elm, field) = (tmp); \
351 RB_AUGMENT(tmp); \ 350 RB_AUGMENT(tmp); \
351 if ((RB_PARENT(tmp, field))) \
352 RB_AUGMENT(RB_PARENT(tmp, field)); \
352} while (0) 353} while (0)
353 354
354#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ 355#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
@@ -362,12 +363,13 @@ struct { \
362 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ 363 RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
363 else \ 364 else \
364 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ 365 RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
365 RB_AUGMENT(RB_PARENT(elm, field)); \
366 } else \ 366 } else \
367 (head)->rbh_root = (tmp); \ 367 (head)->rbh_root = (tmp); \
368 RB_RIGHT(tmp, field) = (elm); \ 368 RB_RIGHT(tmp, field) = (elm); \
369 RB_PARENT(elm, field) = (tmp); \ 369 RB_PARENT(elm, field) = (tmp); \
370 RB_AUGMENT(tmp); \ 370 RB_AUGMENT(tmp); \
371 if ((RB_PARENT(tmp, field))) \
372 RB_AUGMENT(RB_PARENT(tmp, field)); \
371} while (0) 373} while (0)
372 374
373/* Generates prototypes and inline functions */ 375/* Generates prototypes and inline functions */