]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/ofork.c
Fix cmdline option handling
[netatalk.git] / etc / afpd / ofork.c
index 326acd0b0ba565dde9905650b45304120092e981..5fc6a1d5752285c08f82ec407711ddb64edbf0da 100644 (file)
@@ -383,7 +383,7 @@ void of_dealloc( struct ofork *of)
         free( of->of_ad->ad_m_name );
         free( of->of_ad);
     } else {/* someone's still using it. just free this user's locks */
-        ad_unlock(of->of_ad, of->of_refnum);
+        ad_unlock(of->of_ad, of->of_refnum, of->of_flags & AFPFORK_ERROR ? 0 : 1);
     }
 
     free( of );
@@ -404,7 +404,7 @@ int of_closefork(struct ofork *ofork)
     if (ofork->of_flags & AFPFORK_RSRC) {
         adflags |= ADFLAGS_RF;
         /* Only set the rfork's length if we're closing the rfork. */
-        ad_refresh( ofork->of_ad );
+        ad_refresh(NULL, ofork->of_ad );
         if ((ofork->of_flags & AFPFORK_DIRTY) && !gettimeofday(&tv, NULL)) {
             ad_setdate(ofork->of_ad, AD_DATE_MODIFY | AD_DATE_UNIX,tv.tv_sec);
             ad_flush( ofork->of_ad );
@@ -417,7 +417,7 @@ int of_closefork(struct ofork *ofork)
     }
 
     ret = 0;
-    if ( ad_close( ofork->of_ad, adflags ) < 0 ) {
+    if ( ad_close( ofork->of_ad, adflags | ADFLAGS_SETSHRMD) < 0 ) {
         ret = -1;
     }