# HG changeset patch # User Ruslan Ermilov # Date 1341320718 0 # Node ID 9acc1a5a5b9ada472d275091fe217099fd031e25 # Parent cebbe4fda8aa63fc8ae5cc2c5faeb390685a8fec Made sure to initialize the entire "struct flock" allocated on stack. diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c --- a/src/os/unix/ngx_files.c +++ b/src/os/unix/ngx_files.c @@ -413,9 +413,7 @@ ngx_trylock_fd(ngx_fd_t fd) { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; @@ -432,9 +430,7 @@ ngx_lock_fd(ngx_fd_t fd) { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; @@ -451,9 +447,7 @@ ngx_unlock_fd(ngx_fd_t fd) { struct flock fl; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = 0; + ngx_memzero(&fl, sizeof(struct flock)); fl.l_type = F_UNLCK; fl.l_whence = SEEK_SET;