shadow/lib/shadowlog.c
Tobias Stoeckmann d5638a5b2b lib/shadowlog_internal.h: Hide shadow_progname
Accessing and setting shadow_progname is not as straight-forward as it
might seem due to the way of linking libshadow_la with libsubid and
programs.

Enforce the usage of log_get_progname to make this less messy.

With last entry of shadowlog_internal.h gone, remove the file entirely.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-01-12 14:27:05 +01:00

30 lines
451 B
C

#include "shadowlog.h"
static const char *shadow_progname = "libshadow";
static FILE *shadow_logfd = NULL;
void log_set_progname(const char *progname)
{
shadow_progname = progname;
}
const char *log_get_progname(void)
{
return shadow_progname;
}
void log_set_logfd(FILE *fd)
{
if (NULL != fd)
shadow_logfd = fd;
else
shadow_logfd = stderr;
}
FILE *log_get_logfd(void)
{
if (shadow_logfd != NULL)
return shadow_logfd;
return stderr;
}