logger: fix remote logging

Reported-by: Hervé Quillévéré <herve_quillevere@herveq.tk>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-12-08 10:20:22 +01:00
parent 6e7e2c57d5
commit 86248cd28a
1 changed files with 3 additions and 3 deletions

View File

@ -281,7 +281,7 @@ main(int argc, char **argv) {
}
}
if (p != buf) {
if (!usock)
if (!usock && !udpserver)
syslog(pri, "%s", buf);
else
mysyslog(LogSock, logflags, pri, tag, buf);
@ -295,13 +295,13 @@ main(int argc, char **argv) {
if (len > 0 && buf[len - 1] == '\n')
buf[len - 1] = '\0';
if (!usock)
if (!usock && !udpserver)
syslog(pri, "%s", buf);
else
mysyslog(LogSock, logflags, pri, tag, buf);
}
}
if (!usock)
if (!usock && !udpserver)
closelog();
else
close(LogSock);