]> arthur.barton.de Git - netatalk.git/blob - libatalk/adouble/ad_size.c
Log message was using wrong variable
[netatalk.git] / libatalk / adouble / ad_size.c
1 /*
2  *
3  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
4  * All rights reserved. See COPYRIGHT.
5  *
6  * if we could depend upon inline functions, this would be one.
7  */
8
9 #ifdef HAVE_CONFIG_H
10 #include "config.h"
11 #endif /* HAVE_CONFIG_H */
12
13 #include <string.h>
14 #include <atalk/logger.h>
15 #include <atalk/adouble.h>
16
17 off_t ad_size(const struct adouble *ad, const uint32_t eid)
18 {
19   if (eid == ADEID_DFORK) {
20     struct stat st;
21
22     if (ad->ad_data_fork.adf_syml) 
23         return strlen(ad->ad_data_fork.adf_syml);
24
25     if (fstat(ad_data_fileno(ad), &st) < 0)
26       return 0;
27     return st.st_size;
28   }  
29 #if 0
30   return ad_getentrylen(ad, eid);
31 #endif
32   return ad->ad_rlen;  
33