From 11893a3fec6a0ce3a6cf5495148dbe6d7dacdbef Mon Sep 17 00:00:00 2001
From: Lev Kujawski <int21h@mailbox.org>
Date: Wed, 6 Jan 2021 12:12:35 -0700
Subject: [PATCH 02/14] Rename functions within ToolTalk that conflict with the
 musl C library headers.

---
 cde/lib/tt/bin/tttar/tttar_file_utils.C | 14 ++++++--------
 cde/lib/tt/bin/tttar/tttar_file_utils.h |  4 ++--
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/cde/lib/tt/bin/tttar/tttar_file_utils.C b/cde/lib/tt/bin/tttar/tttar_file_utils.C
index e911c29d..52dfb579 100644
--- a/cde/lib/tt/bin/tttar/tttar_file_utils.C
+++ b/cde/lib/tt/bin/tttar/tttar_file_utils.C
@@ -231,8 +231,8 @@ realtrees( _Tt_string_list_ptr paths, bool_t follow_symlinks )
 				 * symlink instead of the path of the
 				 * linked file.
 				 */
-				char *dir = dirname( (char *)path );
-				char *base = basename( (char *)path );
+				char *dir = dirname_tt( (char *)path );
+				char *base = basename_tt( (char *)path );
 				resolved_path = _tt_get_realpath( dir,
 							  resolved_path_buf );
 				if (resolved_path != NULL) {
@@ -354,10 +354,9 @@ append_real_subtrees( _Tt_string_list_ptr realtrees, _Tt_string path )
 } /* append_real_subtrees() */
 
 /*
- * basename() - Return the last component of a pathname.
+ * basename_tt() - Return the last component of a pathname.
  */
-#if !defined(__linux__)
-char *basename( char *pathname ) {
+char *basename_tt( char *pathname ) {
 	char *the_basename;
 	
 	the_basename = strrchr( pathname, '/' );
@@ -368,14 +367,13 @@ char *basename( char *pathname ) {
 	}
 	return the_basename;
 }
-#endif
 
 /*
- * dirname() - Return the pathname minus the basename, or "." if the
+ * dirname_tt() - Return the pathname minus the basename, or "." if the
  *	basename is all there is.  Caller is responsible for free()ing
  *	the storage returned.
  */
-char *dirname( char *pathname ) {
+char *dirname_tt( char *pathname ) {
 	char *the_basename;
 	char *the_dirname;
 	
diff --git a/cde/lib/tt/bin/tttar/tttar_file_utils.h b/cde/lib/tt/bin/tttar/tttar_file_utils.h
index 87de5bb0..0c4c661b 100644
--- a/cde/lib/tt/bin/tttar/tttar_file_utils.h
+++ b/cde/lib/tt/bin/tttar/tttar_file_utils.h
@@ -49,7 +49,7 @@ _Tt_string_list_ptr	realtrees( _Tt_string_list_ptr	paths,
 					bool_t follow_symlinks );
 void		append_real_subtrees( _Tt_string_list_ptr realtrees,
 				      _Tt_string path );
-char	       *basename( char *pathname );
-char	       *dirname( char *pathname );
+char	       *basename_tt( char *pathname );
+char	       *dirname_tt( char *pathname );
 
 #endif /* _LSTAR_FILE_UTILS_H */
-- 
2.30.0

