Cambiato '%' in is_com
Corretta openall. Non memorizzava l'handle del file aperto e ritornava un errore sbagliato git-svn-id: svn://10.65.10.50/trunk@1561 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f61a12fc53
commit
094e90a18d
@ -99,7 +99,7 @@ HIDDEN int closeall(bool changestudy, TBit_array& excl, TBit_array& toclose)
|
||||
{
|
||||
isfdptr isfd = openf[i];
|
||||
d.get(i + 1, _nolock, _nordir, _sysdirop);
|
||||
if (toclose[i + 1] || changestudy || d.name()[0] != '%')
|
||||
if (toclose[i + 1] || changestudy || !d.is_com())
|
||||
{
|
||||
excl.set(i, DB_file_locked(isfd->fhnd) == _excllock);
|
||||
err=DB_close(isfd->fhnd);
|
||||
@ -124,7 +124,7 @@ HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax, TBit_array&
|
||||
if (openf[i] != NULL)
|
||||
{
|
||||
d.get(i + 1, _nolock, _nordir, _sysdirop);
|
||||
if (changestudy || d.name()[0] != '%')
|
||||
if (changestudy || !d.is_com())
|
||||
fatal_box("Can't reopen file n. %d", i + 1);
|
||||
}
|
||||
|
||||
@ -135,9 +135,10 @@ HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax, TBit_array&
|
||||
{
|
||||
isfdptr isfd = openf[i];
|
||||
d.get(i + 1, _nolock, _nordir, _sysdirop);
|
||||
if (toopen[i + 1] || changestudy || d.name()[0] != '%')
|
||||
const bool com = d.is_com();
|
||||
if (toopen[i + 1] || changestudy || !com)
|
||||
{
|
||||
isfd->ft = d.name()[0] == '%' ? _comdir : _nordir;
|
||||
isfd->ft = com ? _comdir : _nordir;
|
||||
d.get(i + 1, _nolock, (TDirtype) isfd->ft);
|
||||
*isfd->d = *d.filedesc();
|
||||
|
||||
@ -146,8 +147,9 @@ HIDDEN void openall(bool changestudy, TBit_array& excl, int oldmax, TBit_array&
|
||||
*isfd->r = *r.rec();
|
||||
if (excllock(CInsPref((char*) glockname, NORDIR), FALSE) == -1 && errno == EACCES)
|
||||
fatal_box("Can't reopen file n. %d : file in use", i + 1);
|
||||
err=DB_open(isfd->d->SysName,excl[i]==_excllock);
|
||||
if (err<0) err=get_error(err);
|
||||
isfd->fhnd = DB_open(isfd->d->SysName,excl[i]==_excllock);
|
||||
if (isfd->fhnd < 0 ) err=get_error(isfd->fhnd);
|
||||
else err = NOERR;
|
||||
if (err == _islocked)
|
||||
fatal_box("Can't reopen file n. %d : file in use", i + 1);
|
||||
if (err != NOERR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user