static int ad_header_read(const char *path, struct adouble *ad, const struct stat *hst);
static int ad_header_upgrade(struct adouble *ad, const char *name);
+#ifdef HAVE_EAFD
static int ad_mkrf_ea(const char *path);
+#endif
static int ad_header_read_ea(const char *path, struct adouble *ad, const struct stat *hst);
static int ad_header_upgrade_ea(struct adouble *ad, const char *name);
static int ad_reso_size(const char *path, int adflags, struct adouble *ad);
adosx.ad_version = ntohl(adosx.ad_version);
if ((adosx.ad_magic != AD_MAGIC) || (adosx.ad_version != AD_VERSION2)) {
- LOG(log_warning, logtype_ad, "ad_valid_header_osx: not an adouble:osx file");
+ LOG(log_warning, logtype_ad, "ad_valid_header_osx(\"%s\"): not an adouble:osx file", fullpathname(path));
EC_FAIL;
}
}
if (header_len < AD_HEADER_LEN) {
- LOG(log_error, logtype_ad, "ad_header_read_ea: bogus AppleDouble header.");
+ LOG(log_error, logtype_ad, "ad_header_read_ea(\"%s\"): bogus AppleDouble header.", fullpathname(path));
errno = EIO;
return -1;
}
ad->ad_version = ntohl( ad->ad_version );
if ((ad->ad_magic != AD_MAGIC) || (ad->ad_version != AD_VERSION2)) {
- LOG(log_error, logtype_ad, "ad_header_read_ea: wrong magic or version");
+ LOG(log_error, logtype_ad, "ad_header_read_ea(\"%s\"): wrong magic or version", fullpathname(path));
errno = EIO;
return -1;
}
if (len + AD_HEADER_LEN > sizeof(ad->ad_data))
len = sizeof(ad->ad_data) - AD_HEADER_LEN;
if (len > header_len - AD_HEADER_LEN) {
- LOG(log_error, logtype_ad, "ad_header_read_ea: can't read entry info.");
+ LOG(log_error, logtype_ad, "ad_header_read_ea(\"%s\"): can't read entry info.", fullpathname(path));
errno = EIO;
return -1;
}
return 0;
}
+#ifdef HAVE_EAFD
static int ad_mkrf_ea(const char *path _U_)
{
AFP_PANIC("ad_mkrf_ea: dont use");
return 0;
}
+#endif
static int ad_mkrf_osx(const char *path _U_)
{
static int ad_open_hf_ea(const char *path, int adflags, int mode, struct adouble *ad)
{
EC_INIT;
- ssize_t rforklen;
int oflags;
int opened = 0;
int oflags;
int opened = 0;
int closeflags = adflags & (ADFLAGS_DF | ADFLAGS_HF);
- ssize_t rlen;
#ifndef HAVE_EAFD
const char *rfpath;
struct stat st;
EC_INIT;
int cwdfd = -1;
va_list args;
- mode_t mode;
+ mode_t mode = 0;
if (dirfd != -1) {
if ((cwdfd = open(".", O_RDONLY) == -1) || (fchdir(dirfd) != 0))
+ if (cwdfd > 0)
+ close(cwdfd);
EC_FAIL;
}