mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
[BZ #108]
Update. * misc/syslog.c (openlog_internal): Always try both UDP and TCP. [BZ #108] Patch mainly by Bjorn Andersson <bjorn@iki.fi>.
This commit is contained in:
parent
0b755dc43f
commit
807645d725
@ -1,5 +1,8 @@
|
||||
2004-08-08 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* misc/syslog.c (openlog_internal): Always try both UDP and TCP.
|
||||
[BZ #108] Patch mainly by Bjorn Andersson <bjorn@iki.fi>.
|
||||
|
||||
* configure.in: Also recognize i786. [BZ #106]
|
||||
Patch by <pluto@pld-linux.org>.
|
||||
|
||||
|
@ -323,7 +323,8 @@ openlog_internal(const char *ident, int logstat, int logfac)
|
||||
if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
|
||||
LogFacility = logfac;
|
||||
|
||||
while (1) {
|
||||
int retry = 0;
|
||||
while (retry < 2) {
|
||||
if (LogFile == -1) {
|
||||
SyslogAddr.sa_family = AF_UNIX;
|
||||
(void)strncpy(SyslogAddr.sa_data, _PATH_LOG,
|
||||
@ -345,12 +346,13 @@ openlog_internal(const char *ident, int logstat, int logfac)
|
||||
int fd = LogFile;
|
||||
LogFile = -1;
|
||||
(void)__close(fd);
|
||||
if (LogType == SOCK_DGRAM
|
||||
&& saved_errno == EPROTOTYPE)
|
||||
__set_errno (old_errno);
|
||||
if (saved_errno == EPROTOTYPE)
|
||||
{
|
||||
/* retry with next SOCK_STREAM: */
|
||||
LogType = SOCK_STREAM;
|
||||
__set_errno (old_errno);
|
||||
/* retry with the other type: */
|
||||
LogType = (LogType == SOCK_DGRAM
|
||||
? SOCK_STREAM : SOCK_DGRAM);
|
||||
++retry;
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user