Return 0 on success and -1 on error.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user