Module Name:    src
Committed By:   kamil
Date:           Sun Jun  3 12:18:29 UTC 2018

Modified Files:
        src/bin/ksh: c_ksh.c edit.c exec.c proto.h table.c table.h

Log Message:
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>


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/ksh/c_ksh.c
cvs rdiff -u -r1.34 -r1.35 src/bin/ksh/edit.c
cvs rdiff -u -r1.27 -r1.28 src/bin/ksh/exec.c
cvs rdiff -u -r1.12 -r1.13 src/bin/ksh/proto.h
cvs rdiff -u -r1.7 -r1.8 src/bin/ksh/table.c
cvs rdiff -u -r1.3 -r1.4 src/bin/ksh/table.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ksh/c_ksh.c
diff -u src/bin/ksh/c_ksh.c:1.28 src/bin/ksh/c_ksh.c:1.29
--- src/bin/ksh/c_ksh.c:1.28	Tue May  8 16:37:59 2018
+++ src/bin/ksh/c_ksh.c	Sun Jun  3 12:18:29 2018
@@ -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 @@ c_unalias(wp)
 	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);

Index: src/bin/ksh/edit.c
diff -u src/bin/ksh/edit.c:1.34 src/bin/ksh/edit.c:1.35
--- src/bin/ksh/edit.c:1.34	Sat Jul  1 23:12:08 2017
+++ src/bin/ksh/edit.c	Sun Jun  3 12:18:29 2018
@@ -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 @@ glob_table(pat, wp, tp)
 	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));
 	}

Index: src/bin/ksh/exec.c
diff -u src/bin/ksh/exec.c:1.27 src/bin/ksh/exec.c:1.28
--- src/bin/ksh/exec.c:1.27	Tue May  8 16:37:59 2018
+++ src/bin/ksh/exec.c	Sun Jun  3 12:18:29 2018
@@ -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 @@ flushcom(all)
 	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);

Index: src/bin/ksh/proto.h
diff -u src/bin/ksh/proto.h:1.12 src/bin/ksh/proto.h:1.13
--- src/bin/ksh/proto.h:1.12	Wed Jan 24 09:53:21 2018
+++ src/bin/ksh/proto.h	Sun Jun  3 12:18:29 2018
@@ -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 @@ void 	tinit		ARGS((struct table *, Area 
 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 */

Index: src/bin/ksh/table.c
diff -u src/bin/ksh/table.c:1.7 src/bin/ksh/table.c:1.8
--- src/bin/ksh/table.c:1.7	Tue May  8 16:37:59 2018
+++ src/bin/ksh/table.c	Sun Jun  3 12:18:29 2018
@@ -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 @@ mytdelete(p)
 }
 
 void
-twalk(ts, tp)
+ksh_twalk(ts, tp)
 	struct tstate *ts;
 	struct table *tp;
 {
@@ -216,7 +216,7 @@ tprintinfo(tp)
 
 	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;
 

Index: src/bin/ksh/table.h
diff -u src/bin/ksh/table.h:1.3 src/bin/ksh/table.h:1.4
--- src/bin/ksh/table.h:1.3	Wed Oct 20 15:10:00 1999
+++ src/bin/ksh/table.h	Sun Jun  3 12:18:29 2018
@@ -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 @@ struct block {
 #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;

Reply via email to