Merge pull request #343 from hallyn/2021-05-23/quiet
libsubid_init: don't print messages on error
This commit is contained in:
commit
0fe42f571c
@ -46,13 +46,11 @@ bool libsubid_init(const char *progname, FILE * logfd)
|
|||||||
{
|
{
|
||||||
if (progname) {
|
if (progname) {
|
||||||
progname = strdup(progname);
|
progname = strdup(progname);
|
||||||
if (progname) {
|
if (progname)
|
||||||
Prog = progname;
|
Prog = progname;
|
||||||
} else {
|
else
|
||||||
fprintf(stderr, "Out of memory");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (logfd) {
|
if (logfd) {
|
||||||
shadow_logfd = logfd;
|
shadow_logfd = logfd;
|
||||||
@ -60,7 +58,6 @@ bool libsubid_init(const char *progname, FILE * logfd)
|
|||||||
}
|
}
|
||||||
shadow_logfd = fopen("/dev/null", "w");
|
shadow_logfd = fopen("/dev/null", "w");
|
||||||
if (!shadow_logfd) {
|
if (!shadow_logfd) {
|
||||||
fprintf(stderr, "ERROR opening /dev/null for error messages. Using stderr.");
|
|
||||||
shadow_logfd = stderr;
|
shadow_logfd = stderr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user