Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149765128
D41389.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41389.id.diff
View Options
diff --git a/usr.sbin/syslogd/syslogd.h b/usr.sbin/syslogd/syslogd.h
--- a/usr.sbin/syslogd/syslogd.h
+++ b/usr.sbin/syslogd/syslogd.h
@@ -314,6 +314,7 @@
extern int MarkInterval;
extern int MaxForwardLen;
extern int family;
+extern int kq;
extern int logflags;
extern int no_compress;
extern int nulldesc;
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -155,6 +155,7 @@
int MarkInterval = 20 * 60; /* interval between marks in seconds */
int MaxForwardLen = 1024; /* max length of forwared message */
int family = PF_UNSPEC; /* protocol family */
+int kq; /* kqueue descriptor */
int logflags = O_WRONLY | O_APPEND; /* flags used to open log files */
int no_compress; /* don't compress messages (1=pipes, 2=all) */
int nulldesc; /* /dev/null descriptor */
@@ -1306,7 +1307,7 @@
struct socklist *sl;
sigset_t sigset = { };
pid_t ppid = -1, spid;
- int ch, kq, error;
+ int ch, error;
char *p;
bool bflag = false, pflag = false, Sflag = false;
diff --git a/usr.sbin/syslogd/syslogd_log.c b/usr.sbin/syslogd/syslogd_log.c
--- a/usr.sbin/syslogd/syslogd_log.c
+++ b/usr.sbin/syslogd/syslogd_log.c
@@ -61,6 +61,7 @@
*/
#include <sys/param.h>
+#include <sys/event.h>
#include <sys/procdesc.h>
#include <sys/queue.h>
#include <sys/stat.h>
@@ -119,6 +120,7 @@
static int
p_open(const char *prog, int *rpd)
{
+ struct kevent ev;
int pfd[2], pd;
pid_t pid;
sigset_t sigset = { };
@@ -178,6 +180,11 @@
(int)pid);
logerror(errmsg);
}
+ EV_SET(&ev, pd, EVFILT_PROCDESC, EV_ADD, 0, 0, NULL);
+ if (kevent(kq, &ev, 1, NULL, 0, NULL) == -1) {
+ logerror("kqueue");
+ exit(1);
+ }
*rpd = pd;
return (pfd[1]);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 27, 10:03 PM (2 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30445469
Default Alt Text
D41389.id.diff (1 KB)
Attached To
Mode
D41389: syslogd: Watch piped procdescs in kqueue
Attached
Detach File
Event Timeline
Log In to Comment