summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2/imgact_coff.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/ibcs2/imgact_coff.c')
-rw-r--r--sys/i386/ibcs2/imgact_coff.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/i386/ibcs2/imgact_coff.c b/sys/i386/ibcs2/imgact_coff.c
index a28ba52..b155ef9 100644
--- a/sys/i386/ibcs2/imgact_coff.c
+++ b/sys/i386/ibcs2/imgact_coff.c
@@ -168,7 +168,7 @@ coff_load_file(struct thread *td, char *name)
unsigned long text_offset = 0, text_address = 0, text_size = 0;
unsigned long data_offset = 0, data_address = 0, data_size = 0;
unsigned long bss_size = 0;
- int i;
+ int i, writecount;
NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME,
UIO_SYSSPACE, name, td);
@@ -181,7 +181,10 @@ coff_load_file(struct thread *td, char *name)
if (vp == NULL)
return ENOEXEC;
- if (vp->v_writecount) {
+ error = VOP_GET_WRITECOUNT(vp, &writecount);
+ if (error != 0)
+ goto fail;
+ if (writecount != 0) {
error = ETXTBSY;
goto fail;
}
OpenPOWER on IntegriCloud