diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-02-22 15:09:59 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-02-22 15:09:59 +0300 |
commit | 029942f4eb7196c2cff0d0e26bc6ff274138f7d8 (patch) | |
tree | f4686c4d7b9cd574fe94c6f4918479a580fecf75 /src/nxt_socketpair.c | |
parent | 059a8642898a6bd4b47d13a1c1d599cd44af7e1c (diff) | |
download | unit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.gz unit-029942f4eb7196c2cff0d0e26bc6ff274138f7d8.tar.bz2 |
I/O operations refactoring.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_socketpair.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nxt_socketpair.c b/src/nxt_socketpair.c index d0449020..e1c303dd 100644 --- a/src/nxt_socketpair.c +++ b/src/nxt_socketpair.c @@ -27,16 +27,16 @@ static ssize_t nxt_recvmsg(nxt_socket_t s, nxt_fd_t *fd, nxt_iobuf_t *iob, nxt_int_t -nxt_socketpair_create(nxt_socket_t *pair) +nxt_socketpair_create(nxt_task_t *task, nxt_socket_t *pair) { if (nxt_slow_path(socketpair(AF_UNIX, NXT_UNIX_SOCKET, 0, pair) != 0)) { - nxt_thread_log_alert("socketpair() failed %E", nxt_errno); + nxt_log(task, NXT_LOG_CRIT, "socketpair() failed %E", nxt_errno); return NXT_ERROR; } - nxt_thread_log_debug("socketpair(): %d:%d", pair[0], pair[1]); + nxt_debug(task, "socketpair(): %d:%d", pair[0], pair[1]); - if (nxt_slow_path(nxt_socket_nonblocking(pair[0]) != NXT_OK)) { + if (nxt_slow_path(nxt_socket_nonblocking(task, pair[0]) != NXT_OK)) { goto fail; } @@ -44,7 +44,7 @@ nxt_socketpair_create(nxt_socket_t *pair) goto fail; } - if (nxt_slow_path(nxt_socket_nonblocking(pair[1]) != NXT_OK)) { + if (nxt_slow_path(nxt_socket_nonblocking(task, pair[1]) != NXT_OK)) { goto fail; } @@ -56,17 +56,17 @@ nxt_socketpair_create(nxt_socket_t *pair) fail: - nxt_socketpair_close(pair); + nxt_socketpair_close(task, pair); return NXT_ERROR; } void -nxt_socketpair_close(nxt_socket_t *pair) +nxt_socketpair_close(nxt_task_t *task, nxt_socket_t *pair) { - nxt_socket_close(pair[0]); - nxt_socket_close(pair[1]); + nxt_socket_close(task, pair[0]); + nxt_socket_close(task, pair[1]); } |