Improved mkstemp() error reporting.

The invocation parameters should be logged as well, notably the path of the file
that is failed to be created.

Also, log level changed to ALERT as it's quite critical error.
This commit is contained in:
Valentin Bartenev
2020-08-05 16:11:20 +03:00
parent 2b53c7bbbd
commit b0ff245ca8

View File

@@ -906,7 +906,7 @@ nxt_h1p_request_body_read(nxt_task_t *task, nxt_http_request_t *r)
b->file->fd = mkstemp((char *) tmp_name.start);
if (nxt_slow_path(b->file->fd == -1)) {
nxt_log(task, NXT_LOG_ERR, "mkstemp() failed %E", nxt_errno);
nxt_alert(task, "mkstemp(%s) failed %E", tmp_name.start, nxt_errno);
status = NXT_HTTP_INTERNAL_SERVER_ERROR;
goto error;