]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/adouble/ad_size.c
More files to ignore
[netatalk.git] / libatalk / adouble / ad_size.c
index 5773cae191a86baf7f8f863bd71f0a3bb95adc6c..b2b29caeae6254fbf5459b2a3d4c47b2d024a7eb 100644 (file)
@@ -1,16 +1,17 @@
 /*
+ * $Id: ad_size.c,v 1.7 2006-09-29 09:39: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 <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <syslog.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
 
+#include <atalk/logger.h>
 #include <atalk/adouble.h>
 
 off_t ad_size(const struct adouble *ad, const u_int32_t eid)
@@ -18,10 +19,12 @@ off_t ad_size(const struct adouble *ad, const u_int32_t eid)
   if (eid == ADEID_DFORK) {
     struct stat st;
     
-    if (fstat(ad_dfileno(ad), &st) < 0)
+    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;  
 }