X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libatalk%2Fadouble%2Fad_lock.c;h=a93c4bfa46f15a534ec2014364feab9576586679;hp=26cf186ae2ecfe0b4d6f5247315b3a7ab4e56af1;hb=7dd2914f71008e321a8e972a43de62e064202d8c;hpb=0b3e659d0a0c96a4b4efedfbe8de3729ee0358db diff --git a/libatalk/adouble/ad_lock.c b/libatalk/adouble/ad_lock.c index 26cf186a..a93c4bfa 100644 --- a/libatalk/adouble/ad_lock.c +++ b/libatalk/adouble/ad_lock.c @@ -1,5 +1,5 @@ /* - * $Id: ad_lock.c,v 1.8 2003-01-16 21:18:15 didg Exp $ + * $Id: ad_lock.c,v 1.9 2003-01-30 17:32:45 didg Exp $ * * Copyright (c) 1998,1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT for more information. @@ -446,6 +446,11 @@ int ad_fcntl_tmplock(struct adouble *ad, const u_int32_t eid, const int type, if (!(type & ADLOCK_FILELOCK)) lock.l_start += ad_getentryoff(ad, eid); } + + if (!(adf->adf_flags & O_RDWR) && (type & ADLOCK_WR)) { + type = (type & ~ADLOCK_WR) | ADLOCK_RD; + } + lock.l_type = XLATE_FCNTL_LOCK(type & ADLOCK_MASK); lock.l_whence = SEEK_SET; lock.l_len = len;