summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-08-25 03:01:54 +0000
committerbde <bde@FreeBSD.org>1999-08-25 03:01:54 +0000
commit1e9a248e2615a5810fdc8b923877aa7d11dc64d6 (patch)
treedec166835506267beb2ceffcb0c5115eed073500 /lib/libkvm/kvm.c
parentd8d1d7a6fa78140fcc075d9bef1ad8921d83c2fa (diff)
downloadFreeBSD-src-1e9a248e2615a5810fdc8b923877aa7d11dc64d6.zip
FreeBSD-src-1e9a248e2615a5810fdc8b923877aa7d11dc64d6.tar.gz
Don't open the swap file. The open descriptor for it hasn't been used
for over 5 years since we switched to using procfs for kvm_uread(). This cleanup was motivated by recent breakage of the default swap file (/dev/drum) when swapon() has not been called.
Diffstat (limited to 'lib/libkvm/kvm.c')
-rw-r--r--lib/libkvm/kvm.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index f8aaab5..5aae585 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -174,7 +174,6 @@ _kvm_open(kd, uf, mf, sf, flag, errout)
kd->vmfd = -1;
kd->pmfd = -1;
- kd->swfd = -1;
kd->nlfd = -1;
kd->vmst = 0;
kd->db = 0;
@@ -214,7 +213,6 @@ _kvm_open(kd, uf, mf, sf, flag, errout)
*/
if (strcmp(mf, _PATH_DEVNULL) == 0) {
kd->vmfd = open(_PATH_DEVNULL, O_RDONLY);
- kd->swfd = open(_PATH_DEVNULL, O_RDONLY);
} else if (strcmp(mf, _PATH_MEM) != 0) {
_kvm_err(kd, kd->program,
"%s: not physical memory device", mf);
@@ -224,10 +222,6 @@ _kvm_open(kd, uf, mf, sf, flag, errout)
_kvm_syserr(kd, kd->program, "%s", _PATH_KMEM);
goto failed;
}
- if ((kd->swfd = open(sf, flag, 0)) < 0) {
- _kvm_syserr(kd, kd->program, "%s", sf);
- goto failed;
- }
}
/*
* Open kvm nlist database. We go ahead and do this
@@ -318,8 +312,6 @@ kvm_close(kd)
error |= close(kd->vmfd);
if (kd->nlfd >= 0)
error |= close(kd->nlfd);
- if (kd->swfd >= 0)
- error |= close(kd->swfd);
if (kd->db != 0)
error |= (kd->db->close)(kd->db);
if (kd->vmst)
OpenPOWER on IntegriCloud