]> arthur.barton.de Git - netatalk.git/commitdiff
After ad_setid don't flush resource fork if it has not been modified.
authordidg <didg>
Mon, 6 Sep 2004 09:38:21 +0000 (09:38 +0000)
committerdidg <didg>
Mon, 6 Sep 2004 09:38:21 +0000 (09:38 +0000)
etc/afpd/file.c
libatalk/adouble/ad_attr.c

index 77398bd4f6a43d3d1f435c74595f457a65601c87..0df32b5cbcbe5135de67115a79f3662e321779be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.92.2.2.2.29 2004-09-02 12:31:55 didg Exp $
+ * $Id: file.c,v 1.92.2.2.2.30 2004-09-06 09:38:21 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -218,12 +218,13 @@ char   stamp[ADEDLEN_PRIVSYN];
             }
         }
 #if AD_VERSION > AD_VERSION1
-        else if (adp && sizeof(dev_t) == ADEDLEN_PRIVDEV && sizeof(ino_t) == ADEDLEN_PRIVINO) {
+        else if (adp ) {
             /* update the ressource fork
              * for a folder adp is always null
              */
-            ad_setid(adp,(vol->v_flags & AFPVOL_NODEV)?0:st->st_dev, st->st_ino, aint, did, vol->v_stamp);
-            ad_flush(adp, ADFLAGS_HF);
+            if (ad_setid(adp,(vol->v_flags & AFPVOL_NODEV)?0:st->st_dev, st->st_ino, aint, did, vol->v_stamp)) {
+                ad_flush(adp, ADFLAGS_HF);
+            }
         }
 #endif    
     }
@@ -1717,8 +1718,9 @@ reenumerate_id(const struct vol *vol, char *name, cnid_t did)
             if ( ad_open( de->d_name, ADFLAGS_HF, O_RDWR, 0, adp ) < 0 ) {
                 continue;
             }
-            ad_setid(adp,(vol->v_flags & AFPVOL_NODEV)?0:path.st.st_dev, path.st.st_ino, aint, did, vol->v_stamp);
-            ad_flush(adp, ADFLAGS_HF);
+            if (ad_setid(adp,(vol->v_flags & AFPVOL_NODEV)?0:path.st.st_dev, path.st.st_ino, aint, did, vol->v_stamp)) {
+               ad_flush(adp, ADFLAGS_HF);
+            }
             ad_close(adp, ADFLAGS_HF);
         }
 #endif /* AD_VERSION > AD_VERSION1 */
index b7694ff58aab1f34539911c854eb205cb186e112..b897cd67ff6cc258b90a8aaf71293c2b2fff4297 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_attr.c,v 1.4.8.6 2004-03-11 19:57:33 didg Exp $
+ * $Id: ad_attr.c,v 1.4.8.7 2004-09-06 09:38:22 didg Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -61,6 +61,7 @@ int ad_setattr(const struct adouble *ad, const u_int16_t attr)
 
 /* -------------- 
  * save file/folder ID in AppleDoubleV2 netatalk private parameters
+ * return 1 if resource fork has been modified
 */
 #if AD_VERSION == AD_VERSION2
 int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_int32_t id, const cnid_t did, const void *stamp)
@@ -82,6 +83,7 @@ int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_in
 
         ad_setentrylen( adp, ADEID_PRIVSYN, ADEDLEN_PRIVSYN);
         memcpy(ad_entry( adp, ADEID_PRIVSYN ), stamp, ADEDLEN_PRIVSYN);
+        return 1;
     }
     return 0;
 }