summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-08-06 15:31:49 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-08-06 15:31:49 +0000
commitc14faaa687389f558836d6a8c54ca98716d7c9c0 (patch)
tree33eec809b52f334c8209d9d5ab9d80ebd2ca6744
parent003a2e0ab906707af711c919e80ccb5b30af9e33 (diff)
downloadnginx-c14faaa687389f558836d6a8c54ca98716d7c9c0.tar.gz
nginx-c14faaa687389f558836d6a8c54ca98716d7c9c0.tar.bz2
Merge of r4738: struct flock initialization.
Made sure to initialize the entire "struct flock" allocated on stack.
-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;