From: didg Date: Tue, 4 May 2004 15:37:13 +0000 (+0000) Subject: ad_read, return 0 if the resource fork is not open. X-Git-Tag: netatalk-2-0-beta2~60 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=5fd8be4e05de62c4f0103b967fbc002b383d45f3;p=netatalk.git ad_read, return 0 if the resource fork is not open. --- diff --git a/libatalk/adouble/ad_read.c b/libatalk/adouble/ad_read.c index 644e68db..f2ddd987 100644 --- a/libatalk/adouble/ad_read.c +++ b/libatalk/adouble/ad_read.c @@ -1,5 +1,5 @@ /* - * $Id: ad_read.c,v 1.5 2003-02-09 15:36:13 didg Exp $ + * $Id: ad_read.c,v 1.5.6.1 2004-05-04 15:37:13 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -75,6 +75,10 @@ ssize_t ad_read( ad, eid, off, buf, buflen) } else { off_t r_off; + if ( ad_hfileno( ad ) == -1 ) { + /* resource fork is not open ( cf etc/afp/fork.c) */ + return 0; + } r_off = ad_getentryoff(ad, eid) + off; if (( cc = adf_pread( &ad->ad_hf, buf, buflen, r_off )) < 0 ) {