return e;
}
-void syslog_parse_priority(char **p, int *priority, bool with_facility) {
+void syslog_parse_priority(const char **p, int *priority, bool with_facility) {
int a = 0, b = 0, c = 0;
int k;
assert(buf);
orig = buf;
- syslog_parse_priority((char**) &buf, &priority, true);
+ syslog_parse_priority(&buf, &priority, true);
if (s->forward_to_syslog)
forward_syslog_raw(s, priority, orig, ucred, tv);
int server_open_syslog_socket(Server *s) {
int one, r;
- struct epoll_event ev;
assert(s);
return -errno;
}
- zero(ev);
- ev.events = EPOLLIN;
- ev.data.fd = s->syslog_fd;
- if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, s->syslog_fd, &ev) < 0) {
- log_error("Failed to add syslog server fd to epoll object: %m");
- return -errno;
+ r = sd_event_add_io(s->event, &s->syslog_event_source, s->syslog_fd, EPOLLIN, process_datagram, s);
+ if (r < 0) {
+ log_error("Failed to add syslog server fd to event loop: %s", strerror(-r));
+ return r;
}
return 0;