mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
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.
This commit is contained in:
parent
2053751093
commit
480bc7e108
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50331
@ -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)
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user