aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_files.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-07-03 13:05:18 +0000
committerRuslan Ermilov <ru@nginx.com>2012-07-03 13:05:18 +0000
commit2219c566d74aa719dcbefda6a379e5ed9e4a468c (patch)
tree3a221db7f05a4a788b0ce56f490c3d484a664742 /src/os/unix/ngx_files.c
parent3484e6d21ca231b32ac6bac86d0c61c92b6b07e8 (diff)
downloadnginx-2219c566d74aa719dcbefda6a379e5ed9e4a468c.tar.gz
nginx-2219c566d74aa719dcbefda6a379e5ed9e4a468c.zip
Made sure to initialize the entire "struct flock" allocated on stack.
Diffstat (limited to 'src/os/unix/ngx_files.c')
-rw-r--r--src/os/unix/ngx_files.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index ca5458104..2dfa1b7a1 100644
--- 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;