From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id dd634c7b; for ; Thu, 11 Dec 2014 04:05:01 -0500 (EST) Date: Thu, 11 Dec 2014 04:05:01 -0500 (EST) Message-Id: <7118977518237841532.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: sync to OpenBSD X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- sync to OpenBSD Modified Files: -------------- mdocml: compat_fts.c compat_reallocarray.c compat_strsep.c Revision Data ------------- Index: compat_reallocarray.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/compat_reallocarray.c,v retrieving revision 1.3 retrieving revision 1.4 diff -Lcompat_reallocarray.c -Lcompat_reallocarray.c -u -p -r1.3 -r1.4 --- compat_reallocarray.c +++ compat_reallocarray.c @@ -6,7 +6,8 @@ int dummy; #else -/* $OpenBSD: malloc.c,v 1.158 2014/04/23 15:07:27 tedu Exp $ */ +/* $Id$ */ +/* $OpenBSD: reallocarray.c,v 1.2 2014/12/08 03:45:00 bcook Exp $ */ /* * Copyright (c) 2008 Otto Moerbeek * @@ -22,12 +23,17 @@ int dummy; * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #include #include #include #include -#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 4)) +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) void * reallocarray(void *optr, size_t nmemb, size_t size) Index: compat_strsep.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/compat_strsep.c,v retrieving revision 1.3 retrieving revision 1.4 diff -Lcompat_strsep.c -Lcompat_strsep.c -u -p -r1.3 -r1.4 --- compat_strsep.c +++ compat_strsep.c @@ -6,7 +6,8 @@ int dummy; #else -/* ($)OpenBSD: strsep.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */ +/* $Id$ */ +/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */ /*- * Copyright (c) 1990, 1993 Index: compat_fts.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/compat_fts.c,v retrieving revision 1.4 retrieving revision 1.5 diff -Lcompat_fts.c -Lcompat_fts.c -u -p -r1.4 -r1.5 --- compat_fts.c +++ compat_fts.c @@ -7,7 +7,7 @@ int dummy; #else /* $Id$ */ -/* $OpenBSD: fts.c,v 1.46 2014/05/25 17:47:04 tedu Exp $ */ +/* $OpenBSD: fts.c,v 1.49 2014/11/23 00:14:22 guenther Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -146,7 +146,8 @@ fts_open(char * const *argv, int options * and ".." are all fairly nasty problems. Note, if we can't get the * descriptor we run anyway, just more slowly. */ - if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0) + if (!ISSET(FTS_NOCHDIR) && + (sp->fts_rfd = open(".", O_RDONLY | O_CLOEXEC)) < 0) SET(FTS_NOCHDIR); if (nitems == 0) @@ -803,7 +804,7 @@ fts_safe_changedir(FTS *sp, FTSENT *p, i newfd = fd; if (ISSET(FTS_NOCHDIR)) return (0); - if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0) + if (fd < 0 && (newfd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC)) < 0) return (-1); if (fstat(newfd, &sb)) { ret = -1; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv