]> arthur.barton.de Git - netatalk.git/commitdiff
ad_open: unset O_TRUNC and O_CREAT in adf_flags if the resource fork is already open
authordidg <didg>
Mon, 1 Mar 2010 21:11:06 +0000 (21:11 +0000)
committerdidg <didg>
Mon, 1 Mar 2010 21:11:06 +0000 (21:11 +0000)
libatalk/adouble/ad_open.c

index 2785cbf17848f8b790f13d5c0d23cc033781b415..316e5e04847039f0a4cb25eee36168693c13fbae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.69 2010-02-10 14:05:37 franklahm Exp $
+ * $Id: ad_open.c,v 1.70 2010-03-01 21:11:06 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -1358,6 +1358,8 @@ int ad_open( const char *path, int adflags, int oflags, int mode, struct adouble
             return -1;
         }
         ad_refresh(ad);
+        /* it's not new anymore */
+        ad->ad_md->adf_flags &= ~( O_TRUNC | O_CREAT );
         ad->ad_md->adf_refcount++;
         goto sfm;
     }