rely on the maildir's existence with "SyncState *"

now that we open the box first, we know that it will exist at this
point.
This commit is contained in:
Oswald Buddenhagen 2011-07-24 20:27:09 +02:00
parent 3169c59e10
commit e5d323cc47

View File

@ -621,17 +621,17 @@ box_selected( int sts, void *aux )
free( cmname );
}
free( csname );
if (!(s = strrchr( svars->dname, '/' ))) {
error( "Error: invalid SyncState '%s'\n", svars->dname );
goto sbail;
}
*s = 0;
if (mkdir( svars->dname, 0700 ) && errno != EEXIST) {
error( "Error: cannot create SyncState directory '%s': %s\n", svars->dname, strerror(errno) );
goto sbail;
}
*s = '/';
}
if (!(s = strrchr( svars->dname, '/' ))) {
error( "Error: invalid SyncState '%s'\n", svars->dname );
goto sbail;
}
*s = 0;
if (mkdir( svars->dname, 0700 ) && errno != EEXIST) {
error( "Error: cannot create SyncState directory '%s': %s\n", svars->dname, strerror(errno) );
goto sbail;
}
*s = '/';
nfasprintf( &svars->jname, "%s.journal", svars->dname );
nfasprintf( &svars->nname, "%s.new", svars->dname );
nfasprintf( &svars->lname, "%s.lock", svars->dname );