mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
Fix previous commit break: Handle case of non override of locked file in Linux.
This commit is contained in:
parent
ac3c2aa6dd
commit
af23c6b3b5
7
file.c
7
file.c
@ -254,20 +254,20 @@ int readin(const char *fname, boolean lockfl)
|
|||||||
int status ;
|
int status ;
|
||||||
fio_code s ;
|
fio_code s ;
|
||||||
|
|
||||||
|
bp = curbp; /* Cheap. */
|
||||||
#if (FILOCK && BSD) || SVR4
|
#if (FILOCK && BSD) || SVR4
|
||||||
if (lockfl && lockchk(fname) == ABORT)
|
if( lockfl && lockchk( fname) == ABORT)
|
||||||
#if PKCODE
|
#if PKCODE
|
||||||
{
|
{
|
||||||
s = FIOFNF;
|
s = FIOFNF;
|
||||||
bp = curbp;
|
|
||||||
strcpy(bp->b_fname, "");
|
strcpy(bp->b_fname, "");
|
||||||
|
mloutstr( "(File in use)") ;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
return ABORT;
|
return ABORT;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
bp = curbp; /* Cheap. */
|
|
||||||
if( (status = bclear( bp)) != TRUE) /* Might be old. */
|
if( (status = bclear( bp)) != TRUE) /* Might be old. */
|
||||||
return status ;
|
return status ;
|
||||||
|
|
||||||
@ -349,6 +349,7 @@ int readin(const char *fname, boolean lockfl)
|
|||||||
ffclose() ; /* Ignore errors. */
|
ffclose() ; /* Ignore errors. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
|
for (wp = wheadp; wp != NULL; wp = wp->w_wndp) {
|
||||||
if (wp->w_bufp == curbp) {
|
if (wp->w_bufp == curbp) {
|
||||||
wp->w_linep = lforw(curbp->b_linep);
|
wp->w_linep = lforw(curbp->b_linep);
|
||||||
|
Loading…
Reference in New Issue
Block a user