]> arthur.barton.de Git - netatalk.git/commitdiff
Fix 0 byte ad-files as reported <http://article.gmane.org/gmane.network.netatalk...
authorfranklahm <franklahm>
Mon, 22 Jun 2009 12:05:15 +0000 (12:05 +0000)
committerfranklahm <franklahm>
Mon, 22 Jun 2009 12:05:15 +0000 (12:05 +0000)
include/atalk/adouble.h
libatalk/adouble/ad_open.c

index 3d880ed4bd6a9d80c8cda3991c51a5b0b614db37..a6f94262e89765c2dab04703a1a6ff10902b5bea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: adouble.h,v 1.36 2009-06-19 13:38:33 franklahm Exp $
+ * $Id: adouble.h,v 1.37 2009-06-22 12:05:15 franklahm Exp $
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -93,7 +93,7 @@
  */
 #define ADEID_DFORK            1
 #define ADEID_RFORK            2
-#define ADEID_NAME             3
+#define ADEID_NAME             3 /* Note: starting with Netatalk 2.1 we do NOT alway set the name */
 #define ADEID_COMMENT          4
 #define ADEID_ICONBW           5
 #define ADEID_ICONCOL          6
@@ -545,7 +545,7 @@ extern int ad_getdate __P((const struct adouble *, unsigned int, u_int32_t *));
 /* ad_attr.c */
 extern int ad_setattr __P((const struct adouble *, const u_int16_t));
 extern int ad_getattr __P((const struct adouble *, u_int16_t *));
-
+/* Note: starting with Netatalk 2.1 we do NOT alway set the name */
 extern int ad_setname __P((struct adouble *, const char *));
 #if AD_VERSION == AD_VERSION2
 extern int ad_setid __P((struct adouble *, const dev_t dev,const ino_t ino, const u_int32_t, const u_int32_t, const void *));
index cd53ba04c24e98418adbf87172856d65205cd732..e32dcba6da75a5799a190b532e8f3d7e08587410 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.42 2009-06-19 13:38:34 franklahm Exp $
+ * $Id: ad_open.c,v 1.43 2009-06-22 12:05:15 franklahm Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -1450,8 +1450,9 @@ int ad_open( path, adflags, oflags, mode, ad )
             /* the file is already deleted, perm, whatever, so return an error*/
             ad_close(ad, adflags);
             errno = err;
-           return -1;
-       }
+            return -1;
+        }
+        ad_flush(ad);
     } else {
        /* Read the adouble header in and parse it.*/
        if (ad->ad_ops->ad_header_read( ad , pst) < 0