diff --git a/.gitignore b/.gitignore index 4c709fa..0582d41 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ Makefile Makefile.in aclocal.m4 autom4te.cache +compile +config.cache config.guess config.h config.h.in @@ -10,6 +12,7 @@ config.status config.sub configure depcomp +INSTALL install-sh libtool ltmain.sh diff --git a/m4/.gitignore b/m4/.gitignore index e69de29..94e6f26 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -0,0 +1,5 @@ +/libtool.m4 +/ltoptions.m4 +/ltsugar.m4 +/ltversion.m4 +/lt~obsolete.m4 diff --git a/rfc3195/.gitignore b/rfc3195/.gitignore new file mode 100644 index 0000000..6559929 --- /dev/null +++ b/rfc3195/.gitignore @@ -0,0 +1 @@ +/liblogging-rfc3195.pc diff --git a/stdlog/.gitignore b/stdlog/.gitignore new file mode 100644 index 0000000..c9dea13 --- /dev/null +++ b/stdlog/.gitignore @@ -0,0 +1,5 @@ +/liblogging-stdlog.pc +/stdlog.3 +/stdlogctl +/stdlogctl.1 +/tester diff --git a/stdlog/file.c b/stdlog/file.c index bace474..2b63d2d 100644 --- a/stdlog/file.c +++ b/stdlog/file.c @@ -80,7 +80,7 @@ static void file_open(stdlog_channel_t ch) { if (ch->d.file.fd == -1) { - if((ch->d.file.fd = open(ch->d.file.name, O_WRONLY|O_CREAT|O_APPEND, 0660)) < 0) + if((ch->d.file.fd = open(ch->d.file.name, O_WRONLY|O_CREAT|O_APPEND|O_CLOEXEC, 0660)) < 0) return; } } diff --git a/stdlog/stdlog-intern.h b/stdlog/stdlog-intern.h index 50d3c44..be0eba6 100644 --- a/stdlog/stdlog-intern.h +++ b/stdlog/stdlog-intern.h @@ -28,6 +28,14 @@ #include #include "stdlog.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + +#ifndef SOCK_CLOEXEC +#define SOCK_CLOEXEC 0 +#endif + #define __STDLOG_MSGBUF_SIZE 4096 #ifndef STDLOG_INTERN_H_INCLUDED #define STDLOG_INTERN_H_INCLUDED diff --git a/stdlog/uxsock.c b/stdlog/uxsock.c index 84c5ad2..d977b4c 100644 --- a/stdlog/uxsock.c +++ b/stdlog/uxsock.c @@ -90,7 +90,7 @@ static void uxs_open(stdlog_channel_t ch) { if (ch->d.uxs.sock == -1) { - if((ch->d.uxs.sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) + if((ch->d.uxs.sock = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) return; memset(&ch->d.uxs.addr, 0, sizeof(ch->d.uxs.addr)); ch->d.uxs.addr.sun_family = AF_UNIX;