Sun Jun 3 12:18:29 2018 UTC ()
ksh: Remove symbol clash with libc
Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.
Sponsored by <The NetBSD Foundation>
(kamil)
diff -r1.28 -r1.29 src/bin/ksh/c_ksh.c
diff -r1.34 -r1.35 src/bin/ksh/edit.c
diff -r1.27 -r1.28 src/bin/ksh/exec.c
diff -r1.12 -r1.13 src/bin/ksh/proto.h
diff -r1.7 -r1.8 src/bin/ksh/table.c
diff -r1.3 -r1.4 src/bin/ksh/table.h
--- src/bin/ksh/c_ksh.c 2018/05/08 16:37:59 1.28
+++ src/bin/ksh/c_ksh.c 2018/06/03 12:18:29 1.29
@@ -1,4 +1,4 @@
-/* $NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $ */
+/* $NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $ */
/*
* built-in Korn commands: c_*
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: c_ksh.c,v 1.28 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: c_ksh.c,v 1.29 2018/06/03 12:18:29 kamil Exp $");
#endif
#include <sys/stat.h>
@@ -1032,7 +1032,7 @@
if (all) {
struct tstate ts;
- for (twalk(&ts, t); (ap = tnext(&ts)); ) {
+ for (ksh_twalk(&ts, t); (ap = tnext(&ts)); ) {
if (ap->flag&ALLOC) {
ap->flag &= ~(ALLOC|ISSET);
afree((void*)ap->val.s, APERM);
--- src/bin/ksh/edit.c 2017/07/01 23:12:08 1.34
+++ src/bin/ksh/edit.c 2018/06/03 12:18:29 1.35
@@ -1,4 +1,4 @@
-/* $NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $ */
+/* $NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $ */
/*
* Command line editing - common code
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: edit.c,v 1.34 2017/07/01 23:12:08 joerg Exp $");
+__RCSID("$NetBSD: edit.c,v 1.35 2018/06/03 12:18:29 kamil Exp $");
#endif
#include <stdbool.h>
@@ -938,7 +938,7 @@
struct tstate ts;
struct tbl *te;
- for (twalk(&ts, tp); (te = tnext(&ts)); ) {
+ for (ksh_twalk(&ts, tp); (te = tnext(&ts)); ) {
if (gmatch(te->name, pat, false))
XPput(*wp, str_save(te->name, ATEMP));
}
--- src/bin/ksh/exec.c 2018/05/08 16:37:59 1.27
+++ src/bin/ksh/exec.c 2018/06/03 12:18:29 1.28
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $ */
+/* $NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $ */
/*
* execute command tree
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: exec.c,v 1.27 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: exec.c,v 1.28 2018/06/03 12:18:29 kamil Exp $");
#endif
#include <sys/stat.h>
@@ -999,7 +999,7 @@
struct tbl *tp;
struct tstate ts;
- for (twalk(&ts, &taliases); (tp = tnext(&ts)) != NULL; )
+ for (ksh_twalk(&ts, &taliases); (tp = tnext(&ts)) != NULL; )
if ((tp->flag&ISSET) && (all || !ISDIRSEP(tp->val.s[0]))) {
if (tp->flag&ALLOC) {
tp->flag &= ~(ALLOC|ISSET);
--- src/bin/ksh/proto.h 2018/01/24 09:53:21 1.12
+++ src/bin/ksh/proto.h 2018/06/03 12:18:29 1.13
@@ -1,9 +1,9 @@
-/* $NetBSD: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $ */
+/* $NetBSD: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $ */
/*
* prototypes for PD-KSH
* originally generated using "cproto.c 3.5 92/04/11 19:28:01 cthuang "
- * $Id: proto.h,v 1.12 2018/01/24 09:53:21 kamil Exp $
+ * $Id: proto.h,v 1.13 2018/06/03 12:18:29 kamil Exp $
*/
#include <stdbool.h>
@@ -219,7 +219,7 @@
struct tbl * mytsearch ARGS((struct table *, const char *, unsigned int));
struct tbl * tenter ARGS((struct table *, const char *, unsigned int));
void mytdelete ARGS((struct tbl *));
-void twalk ARGS((struct tstate *, struct table *));
+void ksh_twalk ARGS((struct tstate *, struct table *));
struct tbl * tnext ARGS((struct tstate *));
struct tbl ** tsort ARGS((struct table *));
/* trace.c */
--- src/bin/ksh/table.c 2018/05/08 16:37:59 1.7
+++ src/bin/ksh/table.c 2018/06/03 12:18:29 1.8
@@ -1,4 +1,4 @@
-/* $NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $ */
+/* $NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $ */
/*
* dynamic hashed associative table for commands and variables
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: table.c,v 1.7 2018/05/08 16:37:59 kamil Exp $");
+__RCSID("$NetBSD: table.c,v 1.8 2018/06/03 12:18:29 kamil Exp $");
#endif
@@ -151,7 +151,7 @@
}
void
-twalk(ts, tp)
+ksh_twalk(ts, tp)
struct tstate *ts;
struct table *tp;
{
@@ -216,7 +216,7 @@
shellf("table size %d, nfree %d\n", tp->size, tp->nfree);
shellf(" Ncmp name\n");
- twalk(&ts, tp);
+ ksh_twalk(&ts, tp);
while ((te = tnext(&ts))) {
struct tbl **pp, *p;
--- src/bin/ksh/table.h 1999/10/20 15:10:00 1.3
+++ src/bin/ksh/table.h 2018/06/03 12:18:29 1.4
@@ -1,4 +1,4 @@
-/* $NetBSD: table.h,v 1.3 1999/10/20 15:10:00 hubertf Exp $ */
+/* $NetBSD: table.h,v 1.4 2018/06/03 12:18:29 kamil Exp $ */
/*
* generic hashed associative table for commands and variables.
@@ -127,7 +127,7 @@
#define BF_DOGETOPTS BIT(0) /* save/restore getopts state */
/*
- * Used by twalk() and tnext() routines.
+ * Used by ksh_twalk() and tnext() routines.
*/
struct tstate {
int left;