kvm_read () returns the number of bytes read and not zero on success.

This commit is contained in:
Martin Baulig
1998-08-08 16:05:21 +00:00
parent 13cf3ae4d0
commit 6d8c10d4ae
2 changed files with 3 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
memset (buf, 0, sizeof (glibtop_cpu));
if (kvm_read (server->machine.kd, nlst [0].n_value,
&cpts, sizeof (cpts)))
&cpts, sizeof (cpts)) != sizeof (cpts))
glibtop_error_io_r (server, "kvm_read (cp_time)");
/* Get the clockrate data */

View File

@@ -55,7 +55,6 @@ glibtop_init_mem_p (glibtop *server)
if (kvm_nlist (server->machine.kd, nlst) != 0)
glibtop_error_io_r (server, "kvm_nlist");
}
void
@@ -78,11 +77,11 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
/* Get the data from kvm_* */
if (kvm_read (server->machine.kd, nlst[0].n_value,
&vmm, sizeof (vmm)))
&vmm, sizeof (vmm)) != sizeof (vmm))
glibtop_error_io_r (server, "kvm_read (cnt)");
if (kvm_read (server->machine.kd, nlst[1].n_value,
&bufspace, sizeof (bufspace)))
&bufspace, sizeof (bufspace)) != sizeof (bufspace))
glibtop_error_io_r (server, "kvm_read (bufspace)");
/* Set the values to return */