libuutil: purge unused functions

Remove vestigial uu_open_tmp().  The problems with this implementation
are many, but the primary one is the TMPPATHFMT macro, which is
unused, and always has been.

Searching around for any users leads only to earlier imports of the
same, identical file, i.a. into an apple repository (which does patch
gethrtime() into it and gives us a copyright date of 2007),
and a MidnightBSD one from 2008.

Searching illumos-gate, uu_open_tmp appears, in current HEAD, three
times: in the header, libuutil's mapfile ABI, and the implementation.

This slowly grows up to eight occurrences as one moves back to the root
"OpenSolaris Launch" commit: the header, implementation, twice in
libuutil's spec ABI, twice (with multilib and non-multilib paths) in
libuutil.so's i386 and SPARC binary db ABIs.

That's 2005, and this file was abandonware even then, it's dead code.

The situation is similar for the uu_dprintf() family of functions and
uu_dump().  Nothing in accessibly recorded history has ever used them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11873
This commit is contained in:
наб
2021-04-12 18:32:43 +02:00
committed by GitHub
parent e086db1656
commit 722b7f9a4c
7 changed files with 1163 additions and 1238 deletions
-27
View File
@@ -252,30 +252,3 @@ uu_init(void)
_uu_main_thread = 1;
(void) pthread_atfork(uu_lockup, uu_release, uu_release_child);
}
/*
* Dump a block of memory in hex+ascii, for debugging
*/
void
uu_dump(FILE *out, const char *prefix, const void *buf, size_t len)
{
const unsigned char *p = buf;
int i;
for (i = 0; i < len; i += 16) {
int j;
(void) fprintf(out, "%s", prefix);
for (j = 0; j < 16 && i + j < len; j++) {
(void) fprintf(out, "%2.2x ", p[i + j]);
}
for (; j < 16; j++) {
(void) fprintf(out, " ");
}
for (j = 0; j < 16 && i + j < len; j++) {
(void) fprintf(out, "%c",
isprint(p[i + j]) ? p[i + j] : '.');
}
(void) fprintf(out, "\n");
}
}