mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-29 07:14:12 +00:00
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>
30 lines
451 B
C
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;
|
|
}
|