X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Fadouble%2Fad_size.c;h=337ff6ed3d5f07075ff286dfa58964488c9158f4;hb=3a43b6ca05ec2b8f0494f8619a82d25204b7b457;hp=5773cae191a86baf7f8f863bd71f0a3bb95adc6c;hpb=31843674b7bd32eabcce3a1ad6159b4f94921f79;p=netatalk.git diff --git a/libatalk/adouble/ad_size.c b/libatalk/adouble/ad_size.c index 5773cae1..337ff6ed 100644 --- a/libatalk/adouble/ad_size.c +++ b/libatalk/adouble/ad_size.c @@ -1,27 +1,34 @@ /* + * $Id: ad_size.c,v 1.8 2010-02-26 14:13:16 didg Exp $ + * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. * * if we could depend upon inline functions, this would be one. */ -#include -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ +#include +#include #include -off_t ad_size(const struct adouble *ad, const u_int32_t eid) +off_t ad_size(const struct adouble *ad, const uint32_t eid) { if (eid == ADEID_DFORK) { struct stat st; - - if (fstat(ad_dfileno(ad), &st) < 0) + + if (ad->ad_data_fork.adf_syml) + return strlen(ad->ad_data_fork.adf_syml); + + if (fstat(ad_data_fileno(ad), &st) < 0) return 0; return st.st_size; } - +#if 0 return ad_getentrylen(ad, eid); +#endif + return ad->ad_rlen; }