Corretta open per eaccess

git-svn-id: svn://10.65.10.50/trunk@1321 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1995-05-02 16:54:08 +00:00
parent 344675392b
commit 46bb7f8543

View File

@ -238,6 +238,8 @@ s = stringa di lavoro per messaggi di errore.
{ {
Str80 name; strcpy(name, (*isfd)->d->SysName); Str80 name; strcpy(name, (*isfd)->d->SysName);
relisfd(isfd); relisfd(isfd);
if (err == EACCESS && mode == ExclLock)
return (*err);
fatal_box("Can't open file n. %d (%s): error %d ", fatal_box("Can't open file n. %d (%s): error %d ",
logicname, name, *err); logicname, name, *err);
} }
@ -249,6 +251,8 @@ s = stringa di lavoro per messaggi di errore.
{ {
CClose(&((*isfd)->f)); CClose(&((*isfd)->f));
relisfd(isfd); relisfd(isfd);
if (err == EACCESS && mode == ExclLock)
return (*err);
fatal_box("Can't open file n. %d (%s): error %d ", fatal_box("Can't open file n. %d (%s): error %d ",
logicname, name, *err); logicname, name, *err);
} }
@ -777,7 +781,7 @@ wrec = buffer di lavoro.
} }
if (isfd->ln > 0) if (isfd->ln > 0)
CCloseDir(isfd->ft); CCloseDir(isfd->ft);
// if (test_share()) /* if (test_share()) */
{ {
junk = cisunlock(isfd, &junk); junk = cisunlock(isfd, &junk);
if (isstate == NOTRANS) if (isstate == NOTRANS)
@ -1071,7 +1075,7 @@ Utilizza la chiave 1 per ritrovare il record da aggiornare.
} }
#else #else
// if (test_share()) /* if (test_share()) */
CLockRec(&isfd->f,isfd->RecNo,UnLock); CLockRec(&isfd->f,isfd->RecNo,UnLock);
#endif #endif
free(oldrec); free(oldrec);
@ -1188,7 +1192,7 @@ oldrec = buffer di lavoro.
if (memcmp(oldrec,record,isfd->d->LenR) == 0) if (memcmp(oldrec,record,isfd->d->LenR) == 0)
{ {
*err = NoErr; *err = NoErr;
// if (test_share()) /* if (test_share()) */
CLockRec(&isfd->f,isfd->RecNo,UnLock); CLockRec(&isfd->f,isfd->RecNo,UnLock);
free(oldrec); free(oldrec);
return(*err); return(*err);
@ -1289,7 +1293,7 @@ key1 = valore della chiave.
if (/* test_share() && */(isfd->r->NKeys) && IndActive && (isfd->f.LockMode != ExclLock)) if (/* test_share() && */(isfd->r->NKeys) && IndActive && (isfd->f.LockMode != ExclLock))
CBUnLockFile(&isfd->i, &werr) ; CBUnLockFile(&isfd->i, &werr) ;
#else #else
// if (test_share()) /* if (test_share()) */
{ {
CLockRec(&isfd->f,isfd->RecNo,UnLock); CLockRec(&isfd->f,isfd->RecNo,UnLock);
if (isfd->r->NKeys && IndActive && if (isfd->r->NKeys && IndActive &&