EC_INIT;
struct adouble adv2;
struct adouble adea;
- const char *adpath;
int adflags;
uint32_t ctime, mtime, afpinfo = 0;
char *emptyad;
LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): BEGIN", fullpathname(path));
+ switch (S_IFMT & sp->st_mode) {
+ case S_IFREG:
+ break;
+ default:
+ return 0;
+ }
+
ad_init(&adea, vol);
ad_init_old(&adv2, AD_VERSION2, adea.ad_options);
+
adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0;
/* Open and lock adouble:v2 file */
LOG(log_debug, logtype_ad,"ad_conv_v22ea_rf(\"%s\"): BEGIN", fullpathname(path));
+ switch (S_IFMT & sp->st_mode) {
+ case S_IFREG:
+ break;
+ default:
+ return 0;
+ }
+
if (S_ISDIR(sp->st_mode))
return 0;
become_root();
- EC_ZERO( ad_conv_v22ea_hf(path, sp, vol) );
- EC_ZERO( ad_conv_v22ea_rf(path, sp, vol) );
+ if (ad_conv_v22ea_hf(path, sp, vol) != 0)
+ goto delete;
+ if (ad_conv_v22ea_rf(path, sp, vol) != 0)
+ goto delete;
+delete:
EC_NULL( adpath = ad_path(path, adflags) );
LOG(log_debug, logtype_ad,"ad_conv_v22ea_hf(\"%s\"): deleting adouble:v2 file: \"%s\"",
path, fullpathname(adpath));
{
EC_INIT;
static char buf[MAXPATHLEN];
- const char *adpath, *p;
+ const char *p;
int adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0;
bstring newpath = NULL;