chiark / gitweb /
license: add GPLv2+ license blurbs everwhere
[elogind.git] / logger.c
index cd2970002c5cf61e4e38e78b005a06444250ef0f..311458bd2660b4c3776b40f699eca3958f955530 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -1,5 +1,24 @@
 /*-*- Mode: C; c-basic-offset: 8 -*-*/
 
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
 #include <sys/socket.h>
 #include <sys/types.h>
 #include <assert.h>
@@ -319,7 +338,7 @@ static int stream_new(Server *s, int server_fd) {
 
         zero(ev);
         ev.data.ptr = stream;
-        ev.events = POLLIN;
+        ev.events = EPOLLIN;
         if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, fd, &ev) < 0) {
                 r = -errno;
                 goto fail;
@@ -429,7 +448,7 @@ static int server_init(Server *s, unsigned n_sockets) {
                 struct epoll_event ev;
 
                 zero(ev);
-                ev.events = POLLIN;
+                ev.events = EPOLLIN;
                 ev.data.ptr = UINT_TO_PTR(SERVER_FD_START+i);
                 if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, SERVER_FD_START+i, &ev) < 0) {
                         r = -errno;
@@ -479,7 +498,7 @@ static int process_event(Server *s, struct epoll_event *ev) {
         if (PTR_TO_UINT(ev->data.ptr) >= SERVER_FD_START &&
             PTR_TO_UINT(ev->data.ptr) < SERVER_FD_START+s->n_server_fd) {
 
-                if (ev->events != POLLIN) {
+                if (ev->events != EPOLLIN) {
                         log_info("Got invalid event from epoll. (1)");
                         return -EIO;
                 }
@@ -495,7 +514,7 @@ static int process_event(Server *s, struct epoll_event *ev) {
 
                 timestamp = now(CLOCK_REALTIME);
 
-                if (!(ev->events & POLLIN)) {
+                if (!(ev->events & EPOLLIN)) {
                         log_info("Got invalid event from epoll. (3)");
                         stream_free(stream);
                         return 0;