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
-28
View File
@@ -98,28 +98,6 @@ extern int *uu_exit_ok(void);
extern int *uu_exit_fatal(void);
extern int *uu_exit_usage(void);
/*
* Debug print facility functions.
*/
typedef struct uu_dprintf uu_dprintf_t;
typedef enum {
UU_DPRINTF_SILENT,
UU_DPRINTF_FATAL,
UU_DPRINTF_WARNING,
UU_DPRINTF_NOTICE,
UU_DPRINTF_INFO,
UU_DPRINTF_DEBUG
} uu_dprintf_severity_t;
extern uu_dprintf_t *uu_dprintf_create(const char *, uu_dprintf_severity_t,
uint_t);
/*PRINTFLIKE3*/
extern void uu_dprintf(uu_dprintf_t *, uu_dprintf_severity_t,
const char *, ...);
extern void uu_dprintf_destroy(uu_dprintf_t *);
extern const char *uu_dprintf_getname(uu_dprintf_t *);
/*
* Identifier test flags and function.
*/
@@ -128,11 +106,6 @@ extern const char *uu_dprintf_getname(uu_dprintf_t *);
int uu_check_name(const char *, uint_t);
/*
* File creation functions.
*/
extern int uu_open_tmp(const char *dir, uint_t uflags);
/*
* Convenience functions.
*/
@@ -149,7 +122,6 @@ extern boolean_t uu_streq(const char *a, const char *b);
extern char *uu_strndup(const char *s, size_t n);
extern boolean_t uu_strbw(const char *a, const char *b);
extern void *uu_memdup(const void *buf, size_t sz);
extern void uu_dump(FILE *out, const char *prefix, const void *buf, size_t len);
/*
* Comparison function type definition.
-6
View File
@@ -46,12 +46,6 @@ void uu_set_error(uint_t);
void uu_panic(const char *format, ...);
struct uu_dprintf {
char *uud_name;
uu_dprintf_severity_t uud_severity;
uint_t uud_flags;
};
/*
* For debugging purposes, libuutil keeps around linked lists of all uu_lists
* and uu_avls, along with pointers to their parents. These can cause false