summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-02-24 08:15:27 +0000
committerphk <phk@FreeBSD.org>1995-02-24 08:15:27 +0000
commit5ca4449181894449d401ac7032b982b4b7a66778 (patch)
tree2a97982efafb4133ffec4f09c783c65c39ce65e4 /lib/libkvm
parenta96d1683ee55f5faffd851a50dcfd786a69259e2 (diff)
downloadFreeBSD-src-5ca4449181894449d401ac7032b982b4b7a66778.zip
FreeBSD-src-5ca4449181894449d401ac7032b982b4b7a66778.tar.gz
Remove some unused variables and fix two blatant core dump triggers.
Diffstat (limited to 'lib/libkvm')
-rw-r--r--lib/libkvm/kvm.c11
-rw-r--r--lib/libkvm/kvm_file.c5
-rw-r--r--lib/libkvm/kvm_proc.c4
3 files changed, 9 insertions, 11 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index b8d342b..7b72075 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -280,20 +280,21 @@ kvm_openfiles(uf, mf, sf, flag, errout)
}
kvm_t *
-kvm_open(uf, mf, sf, flag, program)
+kvm_open(uf, mf, sf, flag, errstr)
const char *uf;
const char *mf;
const char *sf;
int flag;
- const char *program;
+ const char *errstr;
{
register kvm_t *kd;
- if ((kd = malloc(sizeof(*kd))) == NULL && program != NULL) {
- (void)fprintf(stderr, "%s: %s\n", strerror(errno));
+ if ((kd = malloc(sizeof(*kd))) == NULL) {
+ (void)fprintf(stderr, "%s: %s\n",
+ errstr ? errstr : "kvm_open" , strerror(errno));
return (0);
}
- kd->program = program;
+ kd->program = errstr;
return (_kvm_open(kd, uf, mf, sf, flag, NULL));
}
diff --git a/lib/libkvm/kvm_file.c b/lib/libkvm/kvm_file.c
index 398c36c..1e1d6bd 100644
--- a/lib/libkvm/kvm_file.c
+++ b/lib/libkvm/kvm_file.c
@@ -78,10 +78,9 @@ kvm_deadfiles(kd, op, arg, filehead_o, nfiles)
int op, arg, nfiles;
long filehead_o;
{
- int buflen = kd->arglen, needed = buflen, error, n = 0;
- struct file *fp, file, *filehead;
+ int buflen = kd->arglen, n = 0;
+ struct file *fp, *filehead;
register char *where = kd->argspc;
- char *start = where;
/*
* first copyout filehead
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 381c830..c7a95cb 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -465,6 +465,7 @@ kvm_argv(kd, p, addr, narg, maxcnt)
return (kd->argv);
}
}
+ return (0);
}
static void
@@ -579,9 +580,6 @@ kvm_uread(kd, p, uva, buf, len)
char procfile[MAXPATHLEN];
ssize_t amount;
int fd;
- u_long tmpuva = uva;
- int i;
- char *chr;
cp = buf;
OpenPOWER on IntegriCloud