diff options
author | bde <bde@FreeBSD.org> | 1999-08-25 03:01:54 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-08-25 03:01:54 +0000 |
commit | 1e9a248e2615a5810fdc8b923877aa7d11dc64d6 (patch) | |
tree | dec166835506267beb2ceffcb0c5115eed073500 /lib/libkvm | |
parent | d8d1d7a6fa78140fcc075d9bef1ad8921d83c2fa (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libkvm/kvm.c | 8 | ||||
-rw-r--r-- | lib/libkvm/kvm_private.h | 2 |
2 files changed, 1 insertions, 9 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) diff --git a/lib/libkvm/kvm_private.h b/lib/libkvm/kvm_private.h index 92ab146..2d6d07f 100644 --- a/lib/libkvm/kvm_private.h +++ b/lib/libkvm/kvm_private.h @@ -50,7 +50,7 @@ struct __kvm { #define ISALIVE(kd) ((kd)->vmfd >= 0) int pmfd; /* physical memory file (or crashdump) */ int vmfd; /* virtual memory file (-1 if crashdump) */ - int swfd; /* swap file (e.g., /dev/drum) */ + int unused; /* was: swap file (e.g., /dev/drum) */ int nlfd; /* namelist file (e.g., /kernel) */ struct kinfo_proc *procbase; char *argspc; /* (dynamic) storage for argv strings */ |