mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-24 14:41:06 +08:00
[BZ #1499]
* misc/syslog.c (SyslogAddr): Use sockaddr_un instead of sockaddr. (openlog_internal): Adjust for this change.
This commit is contained in:
parent
7735afa212
commit
7ab7969c70
@ -1,5 +1,9 @@
|
|||||||
2005-12-22 Ulrich Drepper <drepper@redhat.com>
|
2005-12-22 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #1499]
|
||||||
|
* misc/syslog.c (SyslogAddr): Use sockaddr_un instead of sockaddr.
|
||||||
|
(openlog_internal): Adjust for this change.
|
||||||
|
|
||||||
* Makeconfig: Define CXXFLAGS. Split out warnings from +gccwarn which
|
* Makeconfig: Define CXXFLAGS. Split out warnings from +gccwarn which
|
||||||
are not understood by the C++ compiler.
|
are not understood by the C++ compiler.
|
||||||
* Makerules: Add rules to build C++ code for test cases.
|
* Makerules: Add rules to build C++ code for test cases.
|
||||||
|
@ -35,6 +35,7 @@ static char sccsid[] = "@(#)syslog.c 8.4 (Berkeley) 3/18/94";
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/syslog.h>
|
#include <sys/syslog.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <sys/un.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -326,7 +327,7 @@ vsyslog(pri, fmt, ap)
|
|||||||
}
|
}
|
||||||
libc_hidden_def (vsyslog)
|
libc_hidden_def (vsyslog)
|
||||||
|
|
||||||
static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
|
static struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -342,9 +343,9 @@ openlog_internal(const char *ident, int logstat, int logfac)
|
|||||||
int retry = 0;
|
int retry = 0;
|
||||||
while (retry < 2) {
|
while (retry < 2) {
|
||||||
if (LogFile == -1) {
|
if (LogFile == -1) {
|
||||||
SyslogAddr.sa_family = AF_UNIX;
|
SyslogAddr.sun_family = AF_UNIX;
|
||||||
(void)strncpy(SyslogAddr.sa_data, _PATH_LOG,
|
(void)strncpy(SyslogAddr.sun_path, _PATH_LOG,
|
||||||
sizeof(SyslogAddr.sa_data));
|
sizeof(SyslogAddr.sun_path));
|
||||||
if (LogStat & LOG_NDELAY) {
|
if (LogStat & LOG_NDELAY) {
|
||||||
if ((LogFile = __socket(AF_UNIX, LogType, 0))
|
if ((LogFile = __socket(AF_UNIX, LogType, 0))
|
||||||
== -1)
|
== -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user