summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_devpoll_engine.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-03-05 17:32:50 +0300
committerValentin Bartenev <vbart@nginx.com>2018-03-05 17:32:50 +0300
commit912a49c6091c1fd9b630d2e0966f0fe1b97a3e42 (patch)
tree5581735807436384796dfd9deff336865c8372e4 /src/nxt_devpoll_engine.c
parentf2090bce21e4fb47d11f992a76ef5c4da74c3233 (diff)
downloadunit-912a49c6091c1fd9b630d2e0966f0fe1b97a3e42.tar.gz
unit-912a49c6091c1fd9b630d2e0966f0fe1b97a3e42.tar.bz2
Reduced number of critical log levels.
Diffstat (limited to '')
-rw-r--r--src/nxt_devpoll_engine.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/nxt_devpoll_engine.c b/src/nxt_devpoll_engine.c
index 07b08189..71ab11a3 100644
--- a/src/nxt_devpoll_engine.c
+++ b/src/nxt_devpoll_engine.c
@@ -128,8 +128,7 @@ nxt_devpoll_create(nxt_event_engine_t *engine, nxt_uint_t mchanges,
engine->u.devpoll.fd = open("/dev/poll", O_RDWR);
if (engine->u.devpoll.fd == -1) {
- nxt_log(&engine->task, NXT_LOG_CRIT, "open(\"/dev/poll\") failed %E",
- nxt_errno);
+ nxt_alert(&engine->task, "open(\"/dev/poll\") failed %E", nxt_errno);
goto fail;
}
@@ -155,8 +154,7 @@ nxt_devpoll_free(nxt_event_engine_t *engine)
nxt_debug(&engine->task, "devpoll %d free", fd);
if (fd != -1 && close(fd) != 0) {
- nxt_log(&engine->task, NXT_LOG_CRIT, "devpoll close(%d) failed %E",
- fd, nxt_errno);
+ nxt_alert(&engine->task, "devpoll close(%d) failed %E", fd, nxt_errno);
}
nxt_free(engine->u.devpoll.events);
@@ -515,9 +513,8 @@ nxt_devpoll_remove(nxt_event_engine_t *engine, nxt_fd_t fd)
}
if (n == -1) {
- nxt_log(&engine->task, NXT_LOG_CRIT,
- "ioctl(%d, DP_ISPOLLED, %d) failed %E",
- engine->u.devpoll.fd, fd, nxt_errno);
+ nxt_alert(&engine->task, "ioctl(%d, DP_ISPOLLED, %d) failed %E",
+ engine->u.devpoll.fd, fd, nxt_errno);
/* Fall through. */
}
@@ -549,8 +546,7 @@ nxt_devpoll_write(nxt_event_engine_t *engine, struct pollfd *pfd, size_t n)
return NXT_OK;
}
- nxt_log(&engine->task, NXT_LOG_CRIT, "devpoll write(%d) failed %E",
- fd, nxt_errno);
+ nxt_alert(&engine->task, "devpoll write(%d) failed %E", fd, nxt_errno);
return NXT_ERROR;
}
@@ -592,7 +588,7 @@ nxt_devpoll_poll(nxt_event_engine_t *engine, nxt_msec_t timeout)
engine->u.devpoll.fd, nevents);
if (nevents == -1) {
- level = (err == NXT_EINTR) ? NXT_LOG_INFO : NXT_LOG_CRIT;
+ level = (err == NXT_EINTR) ? NXT_LOG_INFO : NXT_LOG_ALERT;
nxt_log(&engine->task, level, "ioctl(%d, DP_POLL) failed %E",
engine->u.devpoll.fd, err);
@@ -610,10 +606,10 @@ nxt_devpoll_poll(nxt_event_engine_t *engine, nxt_msec_t timeout)
fd);
if (nxt_slow_path(ev == NULL)) {
- nxt_log(&engine->task, NXT_LOG_CRIT,
- "ioctl(%d, DP_POLL) returned invalid "
- "fd:%d ev:%04Xd rev:%04uXi",
- engine->u.devpoll.fd, fd, pfd->events, events);
+ nxt_alert(&engine->task,
+ "ioctl(%d, DP_POLL) returned invalid "
+ "fd:%d ev:%04Xd rev:%04uXi",
+ engine->u.devpoll.fd, fd, pfd->events, events);
nxt_devpoll_remove(engine, fd);
continue;
@@ -623,9 +619,9 @@ nxt_devpoll_poll(nxt_event_engine_t *engine, nxt_msec_t timeout)
fd, events, ev->read, ev->write);
if (nxt_slow_path(events & (POLLERR | POLLHUP | POLLNVAL)) != 0) {
- nxt_log(ev->task, NXT_LOG_CRIT,
- "ioctl(%d, DP_POLL) error fd:%d ev:%04Xd rev:%04uXi",
- engine->u.devpoll.fd, fd, pfd->events, events);
+ nxt_alert(ev->task,
+ "ioctl(%d, DP_POLL) error fd:%d ev:%04Xd rev:%04uXi",
+ engine->u.devpoll.fd, fd, pfd->events, events);
nxt_work_queue_add(&engine->fast_work_queue, ev->error_handler,
ev->task, ev, ev->data);