Skip to content

Commit 69ca757

Browse files
committed
daemons: default log destination to "automatic" rather than "stderr"
9905bcd promised in documentation that ``-`` would be stderr/syslog autodetection, but mlog_init still treated it as stderr only. Fixes: gromox-1.33-48-g9905bcde5 References: GXH-146
1 parent 48819ff commit 69ca757

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/rfbl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,15 +1099,13 @@ void mlog_init(const char *ident, const char *filename, unsigned int max_level,
10991099
{
11001100
g_max_loglevel = max_level;
11011101
bool for_syslog = false, for_tty = false;
1102-
if (filename == nullptr || *filename == '\0') {
1102+
if (filename == nullptr || *filename == '\0' || strcmp(filename, "-") == 0) {
11031103
if (isatty(STDERR_FILENO))
11041104
for_tty = true;
11051105
else if (getppid() == 1 && getenv("JOURNAL_STREAM") != nullptr)
11061106
for_syslog = true;
11071107
} else if (strcmp(filename, "syslog") == 0) {
11081108
for_syslog = true;
1109-
} else if (strcmp(filename, "-") == 0) {
1110-
for_tty = true;
11111109
}
11121110
if (for_syslog) {
11131111
openlog(ident, LOG_PID, LOG_MAIL);

0 commit comments

Comments
 (0)