From e9a9c5f4bd1d08217eb9edd4a401de466f160be7 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Tue, 11 Jun 2013 21:25:59 +0400 Subject: [PATCH] write -> ngx_write_fd --- hls/ngx_rtmp_hls_module.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hls/ngx_rtmp_hls_module.c b/hls/ngx_rtmp_hls_module.c index 93c7fe2..52f1f79 100644 --- a/hls/ngx_rtmp_hls_module.c +++ b/hls/ngx_rtmp_hls_module.c @@ -336,7 +336,7 @@ static ngx_int_t ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s) { static u_char buffer[1024]; - int fd; + ngx_fd_t fd; u_char *p; ngx_rtmp_hls_ctx_t *ctx; ssize_t n; @@ -367,7 +367,8 @@ retry: } ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno, - "hls: open failed: '%V'", &ctx->playlist_bak); + "hls: " ngx_open_file_n " failed: '%V'", + &ctx->playlist_bak); return NGX_ERROR; } @@ -388,10 +389,11 @@ retry: "#EXT-X-TARGETDURATION:%ui\n", ctx->frag, max_frag); - n = write(fd, buffer, p - buffer); + n = ngx_write_fd(fd, buffer, p - buffer); if (n < 0) { ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno, - "hls: write failed: '%V'", &ctx->playlist_bak); + "hls: " ngx_write_fd_n " failed: '%V'", + &ctx->playlist_bak); ngx_close_file(fd); return NGX_ERROR; } @@ -413,10 +415,11 @@ retry: "discont=%i", ctx->frag, i + 1, ctx->nfrags, f->duration, f->discont); - n = write(fd, buffer, p - buffer); + n = ngx_write_fd(fd, buffer, p - buffer); if (n < 0) { ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno, - "hls: write failed '%V'", &ctx->playlist_bak); + "hls: " ngx_write_fd_n " failed '%V'", + &ctx->playlist_bak); ngx_close_file(fd); return NGX_ERROR; }