Changeset 6f949e


Ignore:
Timestamp:
2008-10-20 19:40:32 (6 years ago)
Author:
Dag Erling Smørgrav <des@…>
Branches:
master, 3.0, 4.0, experimental-ims
Children:
22edaa
Parents:
81cfa4
git-author:
Dag Erling Smørgrav <des@…> (2008-10-20 19:40:32)
git-committer:
Dag Erling Smørgrav <des@…> (2008-10-20 19:40:32)
Message:

Sync with FreeBSD

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@3335 d4fa192b-c00b-0410-8231-f00ffab90ce4

Location:
lib/libvarnish
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libvarnish/flopen.c

    rca7d4b r6f949e  
    2727 * $Id$ 
    2828 * Derived from: 
    29  * $FreeBSD: src/lib/libutil/flopen.c,v 1.7 2007/05/23 12:09:33 des Exp $ 
     29 * $FreeBSD: head/lib/libutil/flopen.c 184094 2008-10-20 18:11:30Z des $ 
    3030 */ 
    3131 
    3232#include "config.h" 
    3333 
    34 #include <sys/file.h> 
    3534#include <sys/stat.h> 
    3635 
     
    3837#include <fcntl.h> 
    3938#include <stdarg.h> 
     39#include <string.h> 
    4040#include <unistd.h> 
    4141 
     
    4747{ 
    4848        int fd, operation, serrno, trunc; 
     49        struct flock lock; 
    4950        struct stat sb, fsb; 
    50         struct flock lock; 
    5151        mode_t mode; 
    5252 
     
    6464        } 
    6565 
     66        memset(&lock, 0, sizeof lock); 
    6667        lock.l_type = ((flags & O_ACCMODE) == O_RDONLY) ? F_RDLCK : F_WRLCK; 
    67         lock.l_start = 0; 
    6868        lock.l_whence = SEEK_SET; 
    69         lock.l_len = 0; 
    7069        operation = (flags & O_NONBLOCK) ? F_SETLK : F_SETLKW; 
    7170 
  • lib/libvarnish/vpf.c

    rca7d4b r6f949e  
    2626 * $Id$ 
    2727 * Derived from: 
    28  * $FreeBSD: src/lib/libutil/pidfile.c,v 1.5 2007/05/11 11:10:05 des Exp $ 
     28 * $FreeBSD: head/lib/libutil/pidfile.c 184091 2008-10-20 17:41:08Z des $ 
    2929 */ 
    3030 
     
    231231_vpf_remove(struct pidfh *pfh, int freeit) 
    232232{ 
    233         struct flock lock; 
    234233        int error; 
    235234 
    236         lock.l_type = F_UNLCK; 
    237         lock.l_start = 0; 
    238         lock.l_whence = SEEK_SET; 
    239         lock.l_len = 0; 
    240  
    241235        error = vpf_verify(pfh); 
    242236        if (error != 0) { 
     
    247241        if (unlink(pfh->pf_path) == -1) 
    248242                error = errno; 
    249         if (fcntl(pfh->pf_fd, F_SETLK, &lock) == -1) { 
    250                 if (error == 0) 
    251                         error = errno; 
    252         } 
    253243        if (close(pfh->pf_fd) == -1) { 
    254244                if (error == 0) 
Note: See TracChangeset for help on using the changeset viewer.