uint32_t temp;
uint16_t nent;
char *buf, *nentp;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_v2");
uint32_t temp;
uint16_t nent;
char *buf, *nentp;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_ea");
uint32_t temp;
uint16_t nent;
char *buf;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_osx");
}
add->ad_rlen = ads->ad_rlen;
- if ((ads->ad_vers == AD_VERSION2) && (add->ad_vers = AD_VERSION_EA)
- || (ads->ad_vers == AD_VERSION_EA) && (add->ad_vers = AD_VERSION2)) {
+ if (((ads->ad_vers == AD_VERSION2) && (add->ad_vers == AD_VERSION_EA))
+ || ((ads->ad_vers == AD_VERSION_EA) && (add->ad_vers == AD_VERSION2))) {
cnid_t id;
memcpy(&id, ad_entry(add, ADEID_PRIVID), sizeof(cnid_t));
id = htonl(id);
if (ad->ad_adflags & ADFLAGS_DIR) {
EC_NEG1_LOG( cwd = open(".", O_RDONLY) );
EC_NEG1_LOG( fchdir(ad_data_fileno(ad)) );
- EC_ZERO_LOG( sys_lsetxattr(".", AD_EA_META, ad->ad_data, AD_DATASZ_EA, 0) );
+ EC_ZERO_LOGSTR( sys_lsetxattr(".", AD_EA_META, ad->ad_data, AD_DATASZ_EA, 0),
+ "sys_lsetxattr(\"%s\"): %s", fullpathname(".") ,strerror(errno));
EC_NEG1_LOG( fchdir(cwd) );
EC_NEG1_LOG( close(cwd) );
cwd = -1;
if ((adflags & ADFLAGS_DF) && (ad_data_fileno(ad) >= 0 || ad_data_fileno(ad) == AD_SYMLINK)) {
if (ad->ad_data_refcount)
- ad->ad_data_refcount--;
+ if (--ad->ad_data_refcount == 0)
+ adf_lock_free(&ad->ad_data_fork);
if (--ad->ad_data_fork.adf_refcount == 0) {
if (ad_data_closefd(ad) < 0)
err = -1;
- adf_lock_free(&ad->ad_data_fork);
}
}
if (close( ad_meta_fileno(ad)) < 0)
err = -1;
ad_meta_fileno(ad) = -1;
- if (ad->ad_vers == AD_VERSION2)
- adf_lock_free(ad->ad_mdp);
}
}
if (adflags & ADFLAGS_RF) {
if (ad->ad_reso_refcount)
- ad->ad_reso_refcount--;
+ if (--ad->ad_reso_refcount == 0)
+ adf_lock_free(ad->ad_rfp);
if (ad->ad_vers == AD_VERSION_EA) {
if ((ad_reso_fileno(ad) != -1)
&& !(--ad->ad_rfp->adf_refcount)) {
err = -1;
ad->ad_rlen = 0;
ad_reso_fileno(ad) = -1;
- adf_lock_free(ad->ad_rfp);
}
}
}