afp_openfork() we need to keep track if we (re)open the ressource fork.
it was a problem if:
- there's no ressource fork
- the data fork is open read write
- the ressource fork is open read write
- the data fork is closed.
With a Mac it was an issue with noadouble and no .AppleDouble folder,
otherwise the ressource fork is always created before opening the data fork.
(if it can't, because permission on .AppleDouble, then the RF can't be open
read write).
enumerate.c:
more if ((A = B) == C) to (C == (A = B))
adddir() free allocated memory
file.c:
use the new getmetada() format
copyfile() use ad_open, with the new ADFLAGS_NOHF attrib., rather than
open syscall.
afp_creatfile() if there's an error in ressource fork creation then delete
the data fork if any. It's the reason for ADFLAGS_NOHF, we need to be sure
that the data fork was created by us, ie we have a file descriptor for it.
filedir.c:
remove cnid_delete(), now in deletefile()
adouble.h:
add a new attrib. ADFLAGS_NOHF mean don't return an error if there's
no ressource fork.
Helper for using ad_open in copyfile() and in afp_createfile()
cnid.h:
add CNID_ERR_CLOSE error, not used for now.
ad_lock.c:
ad_fcntl_lock() a previous fix a typo =/==, and now we have a
reference used after freed in realloc.