summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-09-23 14:06:56 -0700
committerElliott Hughes <enh@google.com>2014-09-23 14:06:56 -0700
commit49eed7db79bd2664a2a13552ad81d445c93ba462 (patch)
tree5aed7a53313e7832097542e538d829ae4c1fd34a /libc
parent93951cfa96c3c7504a78f94e7ec408936e5db9bf (diff)
downloadbionic-49eed7db79bd2664a2a13552ad81d445c93ba462.zip
bionic-49eed7db79bd2664a2a13552ad81d445c93ba462.tar.gz
bionic-49eed7db79bd2664a2a13552ad81d445c93ba462.tar.bz2
Switch to OpenBSD insque/remque/killpg.
Change-Id: Ie02290ad3187b1c1596dd776fd1c8a743a55f7ef
Diffstat (limited to 'libc')
-rw-r--r--libc/Android.mk6
-rw-r--r--libc/upstream-openbsd/lib/libc/compat-43/killpg.c (renamed from libc/upstream-netbsd/lib/libc/unistd/killpg.c)15
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/insque.c (renamed from libc/upstream-netbsd/lib/libc/stdlib/insque.c)30
-rw-r--r--libc/upstream-openbsd/lib/libc/stdlib/remque.c (renamed from libc/upstream-netbsd/lib/libc/stdlib/remque.c)21
4 files changed, 26 insertions, 46 deletions
diff --git a/libc/Android.mk b/libc/Android.mk
index cb55fd4..dae254f 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -288,7 +288,6 @@ libc_upstream_netbsd_src_files := \
upstream-netbsd/lib/libc/stdlib/div.c \
upstream-netbsd/lib/libc/stdlib/drand48.c \
upstream-netbsd/lib/libc/stdlib/erand48.c \
- upstream-netbsd/lib/libc/stdlib/insque.c \
upstream-netbsd/lib/libc/stdlib/jrand48.c \
upstream-netbsd/lib/libc/stdlib/ldiv.c \
upstream-netbsd/lib/libc/stdlib/lldiv.c \
@@ -297,14 +296,12 @@ libc_upstream_netbsd_src_files := \
upstream-netbsd/lib/libc/stdlib/nrand48.c \
upstream-netbsd/lib/libc/stdlib/_rand48.c \
upstream-netbsd/lib/libc/stdlib/rand_r.c \
- upstream-netbsd/lib/libc/stdlib/remque.c \
upstream-netbsd/lib/libc/stdlib/seed48.c \
upstream-netbsd/lib/libc/stdlib/srand48.c \
upstream-netbsd/lib/libc/string/memccpy.c \
upstream-netbsd/lib/libc/string/strcasestr.c \
upstream-netbsd/lib/libc/string/strcoll.c \
upstream-netbsd/lib/libc/string/strxfrm.c \
- upstream-netbsd/lib/libc/unistd/killpg.c \
libc_upstream_openbsd_gdtoa_src_files := \
upstream-openbsd/android/gdtoa_support.cpp \
@@ -334,6 +331,7 @@ libc_upstream_openbsd_gdtoa_src_files_64 := \
upstream-openbsd/lib/libc/gdtoa/strtorQ.c \
libc_upstream_openbsd_src_files := \
+ upstream-openbsd/lib/libc/compat-43/killpg.c \
upstream-openbsd/lib/libc/crypt/arc4random.c \
upstream-openbsd/lib/libc/crypt/arc4random_uniform.c \
upstream-openbsd/lib/libc/gen/alarm.c \
@@ -480,7 +478,9 @@ libc_upstream_openbsd_src_files := \
upstream-openbsd/lib/libc/stdlib/atoll.c \
upstream-openbsd/lib/libc/stdlib/exit.c \
upstream-openbsd/lib/libc/stdlib/getenv.c \
+ upstream-openbsd/lib/libc/stdlib/insque.c \
upstream-openbsd/lib/libc/stdlib/lsearch.c \
+ upstream-openbsd/lib/libc/stdlib/remque.c \
upstream-openbsd/lib/libc/stdlib/setenv.c \
upstream-openbsd/lib/libc/stdlib/strtoimax.c \
upstream-openbsd/lib/libc/stdlib/strtol.c \
diff --git a/libc/upstream-netbsd/lib/libc/unistd/killpg.c b/libc/upstream-openbsd/lib/libc/compat-43/killpg.c
index ceac3f4..75b1ad9 100644
--- a/libc/upstream-netbsd/lib/libc/unistd/killpg.c
+++ b/libc/upstream-openbsd/lib/libc/compat-43/killpg.c
@@ -1,8 +1,6 @@
-/* $NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $ */
-
/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,15 +27,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
-#else
-__RCSID("$NetBSD: killpg.c,v 1.8 2003/08/07 16:42:39 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/insque.c b/libc/upstream-openbsd/lib/libc/stdlib/insque.c
index 09020ae..590ff83 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/insque.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/insque.c
@@ -1,7 +1,9 @@
+/* $OpenBSD: insque.c,v 1.3 2014/08/15 04:14:36 guenther Exp $ */
+
/*
* Copyright (c) 1993 John Brezak
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,7 +14,7 @@
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may be used to endorse or promote products
* derived from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -26,12 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: insque.c,v 1.3 2012/06/25 22:32:45 abs Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
+#include <stdlib.h>
#include <search.h>
struct qelem {
@@ -42,17 +39,16 @@ struct qelem {
void
insque(void *entry, void *pred)
{
- struct qelem *e = (struct qelem *) entry;
- struct qelem *p = (struct qelem *) pred;
-
- _DIAGASSERT(e != 0);
+ struct qelem *e = entry;
+ struct qelem *p = pred;
- e->q_back = p;
- if (p) {
+ if (p == NULL)
+ e->q_forw = e->q_back = NULL;
+ else {
e->q_forw = p->q_forw;
- if (p->q_forw)
+ e->q_back = p;
+ if (p->q_forw != NULL)
p->q_forw->q_back = e;
p->q_forw = e;
- } else
- e->q_forw = 0;
+ }
}
diff --git a/libc/upstream-netbsd/lib/libc/stdlib/remque.c b/libc/upstream-openbsd/lib/libc/stdlib/remque.c
index 6060ad8..71b74b2 100644
--- a/libc/upstream-netbsd/lib/libc/stdlib/remque.c
+++ b/libc/upstream-openbsd/lib/libc/stdlib/remque.c
@@ -1,7 +1,9 @@
+/* $OpenBSD: remque.c,v 1.3 2014/08/15 04:14:36 guenther Exp $ */
+
/*
* Copyright (c) 1993 John Brezak
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -12,7 +14,7 @@
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may be used to endorse or promote products
* derived from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -26,12 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: remque.c,v 1.3 2012/06/25 22:32:45 abs Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <assert.h>
+#include <stdlib.h>
#include <search.h>
struct qelem {
@@ -42,12 +39,10 @@ struct qelem {
void
remque(void *element)
{
- struct qelem *e = (struct qelem *) element;
-
- _DIAGASSERT(e != 0);
+ struct qelem *e = element;
- if (e->q_forw)
+ if (e->q_forw != NULL)
e->q_forw->q_back = e->q_back;
- if (e->q_back)
+ if (e->q_back != NULL)
e->q_back->q_forw = e->q_forw;
}