diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-03-09 18:03:27 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-03-09 18:03:27 +0300 |
commit | 6f2c9acd1841ca20a1388b34aef64e9f00459090 (patch) | |
tree | c0b9c1063ec464027d1ca29a793f6c0b7a6878d5 /src/nxt_file.c | |
parent | 5745e4826427155e29c1d520fe77811a0f570689 (diff) | |
download | unit-6f2c9acd1841ca20a1388b34aef64e9f00459090.tar.gz unit-6f2c9acd1841ca20a1388b34aef64e9f00459090.tar.bz2 |
Processes refactoring.
The cycle has been renamed to the runtime.
Diffstat (limited to 'src/nxt_file.c')
-rw-r--r-- | src/nxt_file.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nxt_file.c b/src/nxt_file.c index ddde8a9e..8381dc74 100644 --- a/src/nxt_file.c +++ b/src/nxt_file.c @@ -8,11 +8,9 @@ nxt_int_t -nxt_file_open(nxt_file_t *file, nxt_uint_t mode, nxt_uint_t create, - nxt_file_access_t access) +nxt_file_open(nxt_task_t *task, nxt_file_t *file, nxt_uint_t mode, + nxt_uint_t create, nxt_file_access_t access) { - nxt_thread_debug(thr); - #ifdef __CYGWIN__ mode |= O_BINARY; #endif @@ -24,18 +22,20 @@ nxt_file_open(nxt_file_t *file, nxt_uint_t mode, nxt_uint_t create, file->error = (file->fd == -1) ? nxt_errno : 0; - nxt_thread_time_debug_update(thr); +#if (NXT_DEBUG) + nxt_thread_time_update(task->thread); +#endif - nxt_log_debug(thr->log, "open(\"%FN\", 0x%uXi, 0x%uXi): %FD err:%d", - file->name, mode, access, file->fd, file->error); + nxt_debug(task, "open(\"%FN\", 0x%uXi, 0x%uXi): %FD err:%d", + file->name, mode, access, file->fd, file->error); if (file->fd != -1) { return NXT_OK; } if (file->log_level != 0) { - nxt_thread_log_error(file->log_level, "open(\"%FN\") failed %E", - file->name, file->error); + nxt_log(task, file->log_level, "open(\"%FN\") failed %E", + file->name, file->error); } return NXT_ERROR; @@ -43,13 +43,13 @@ nxt_file_open(nxt_file_t *file, nxt_uint_t mode, nxt_uint_t create, void -nxt_file_close(nxt_file_t *file) +nxt_file_close(nxt_task_t *task, nxt_file_t *file) { - nxt_thread_log_debug("close(%FD)", file->fd); + nxt_debug(task, "close(%FD)", file->fd); if (close(file->fd) != 0) { - nxt_thread_log_error(NXT_LOG_CRIT, "close(%FD, \"%FN\") failed %E", - file->fd, file->name, nxt_errno); + nxt_log(task, NXT_LOG_CRIT, "close(%FD, \"%FN\") failed %E", + file->fd, file->name, nxt_errno); } } |