]> arthur.barton.de Git - netatalk.git/commitdiff
Pre-decrement ad_refcount
authorFrank Lahm <franklahm@googlemail.com>
Wed, 12 Jan 2011 16:29:31 +0000 (17:29 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 12 Jan 2011 16:29:31 +0000 (17:29 +0100)
etc/afpd/ofork.c
include/atalk/adouble.h

index d92fb27a9242adafdec3abaaba6cacc1f0371810..a9bc8d51b3d7ece03c49aea6b188d2950210974f 100644 (file)
@@ -404,15 +404,10 @@ void of_dealloc( struct ofork *of)
 int of_closefork(struct ofork *ofork)
 {
     struct timeval      tv;
-    int         adflags, doflush = 0;
+    int         doflush = 0;
     int                 ret;
 
-    adflags = 0;
-    if ((ofork->of_flags & AFPFORK_DATA) && (ad_data_fileno( ofork->of_ad ) != -1)) {
-        adflags |= ADFLAGS_DF;
-    }
     if ( (ofork->of_flags & AFPFORK_OPEN) && ad_reso_fileno( ofork->of_ad ) != -1 ) {
-        adflags |= ADFLAGS_HF;
         /*
          * Only set the rfork's length if we're closing the rfork.
          */
@@ -428,10 +423,9 @@ int of_closefork(struct ofork *ofork)
         }
     }
     ret = 0;
-
     
     if (ad_unref(ofork->of_ad) == 0) {
-        if ( ad_close( ofork->of_ad, adflags ) < 0 ) {
+        if ( ad_close( ofork->of_ad, 0 ) < 0 ) {
             ret = -1;
         }
     }
index 1151e2f49299ae4d31aea9f40ac981ed397d2bed..4ad6c20ca5bcb02d3d6bb7c843b1578963cecd92 100644 (file)
@@ -345,7 +345,7 @@ struct adouble {
 
 /* Refcounting open forks using one struct adouble */
 #define ad_ref(ad)   (ad)->ad_refcount++
-#define ad_unref(ad) (ad)->ad_refcount--
+#define ad_unref(ad) --((ad)->ad_refcount)
 
 /* ad_flush.c */
 extern int ad_rebuild_adouble_header (struct adouble *);