comparison src/os/unix/ngx_files.c @ 680:597573166f34 NGINX_1_3_3

nginx 1.3.3 *) Feature: entity tags support and the "etag" directive. *) Bugfix: trailing dot in a source value was not ignored if the "map" directive was used with the "hostnames" parameter. *) Bugfix: incorrect location might be used to process a request if a URI was changed via a "rewrite" directive before an internal redirect to a named location.
author Igor Sysoev <http://sysoev.ru>
date Tue, 10 Jul 2012 00:00:00 +0400
parents d0f7a625f27c
children 660139fd80ca
comparison
equal deleted inserted replaced
679:cad34cec7d3b 680:597573166f34
411 ngx_err_t 411 ngx_err_t
412 ngx_trylock_fd(ngx_fd_t fd) 412 ngx_trylock_fd(ngx_fd_t fd)
413 { 413 {
414 struct flock fl; 414 struct flock fl;
415 415
416 fl.l_start = 0; 416 ngx_memzero(&fl, sizeof(struct flock));
417 fl.l_len = 0;
418 fl.l_pid = 0;
419 fl.l_type = F_WRLCK; 417 fl.l_type = F_WRLCK;
420 fl.l_whence = SEEK_SET; 418 fl.l_whence = SEEK_SET;
421 419
422 if (fcntl(fd, F_SETLK, &fl) == -1) { 420 if (fcntl(fd, F_SETLK, &fl) == -1) {
423 return ngx_errno; 421 return ngx_errno;
430 ngx_err_t 428 ngx_err_t
431 ngx_lock_fd(ngx_fd_t fd) 429 ngx_lock_fd(ngx_fd_t fd)
432 { 430 {
433 struct flock fl; 431 struct flock fl;
434 432
435 fl.l_start = 0; 433 ngx_memzero(&fl, sizeof(struct flock));
436 fl.l_len = 0;
437 fl.l_pid = 0;
438 fl.l_type = F_WRLCK; 434 fl.l_type = F_WRLCK;
439 fl.l_whence = SEEK_SET; 435 fl.l_whence = SEEK_SET;
440 436
441 if (fcntl(fd, F_SETLKW, &fl) == -1) { 437 if (fcntl(fd, F_SETLKW, &fl) == -1) {
442 return ngx_errno; 438 return ngx_errno;
449 ngx_err_t 445 ngx_err_t
450 ngx_unlock_fd(ngx_fd_t fd) 446 ngx_unlock_fd(ngx_fd_t fd)
451 { 447 {
452 struct flock fl; 448 struct flock fl;
453 449
454 fl.l_start = 0; 450 ngx_memzero(&fl, sizeof(struct flock));
455 fl.l_len = 0;
456 fl.l_pid = 0;
457 fl.l_type = F_UNLCK; 451 fl.l_type = F_UNLCK;
458 fl.l_whence = SEEK_SET; 452 fl.l_whence = SEEK_SET;
459 453
460 if (fcntl(fd, F_SETLK, &fl) == -1) { 454 if (fcntl(fd, F_SETLK, &fl) == -1) {
461 return ngx_errno; 455 return ngx_errno;