Return 0 on success and -1 on error.

This commit is contained in:
Martin Baulig
1999-10-24 20:17:42 +00:00
parent 507f171b63
commit 7a9bb6e43d
20 changed files with 153 additions and 65 deletions

View File

@@ -43,6 +43,8 @@ int
glibtop_init_proc_signal_p (glibtop *server)
{
server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal;
return 0;
}
int
@@ -58,13 +60,13 @@ glibtop_get_proc_signal_p (glibtop *server,
memset (buf, 0, sizeof (glibtop_proc_signal));
/* It does not work for the swapper task. */
if (pid == 0) return;
if (pid == 0) return -1;
/* Get the process information */
pinfo = kvm_getprocs (server->machine.kd, KERN_PROC_PID, pid, &count);
if ((pinfo == NULL) || (count != 1)) {
glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid);
return;
return -1;
}
/* signal: mask of pending signals.
@@ -104,4 +106,6 @@ glibtop_get_proc_signal_p (glibtop *server,
#endif
buf->flags = _glibtop_sysdeps_proc_signal;
return 0;
}