Reflect latest interface changes; especially all functions now return

appropriate error return values on error.
This commit is contained in:
Martin Baulig
1999-12-25 18:54:52 +00:00
parent 1979cb8104
commit dbb5f9b636
8 changed files with 49 additions and 16 deletions

View File

@@ -35,6 +35,8 @@ int
glibtop_init_uptime_s (glibtop *server)
{
server->sysdeps.uptime = _glibtop_sysdeps_uptime;
return 0;
}
/* Provides uptime and idle time. */
@@ -45,9 +47,11 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
memset (buf, 0, sizeof (glibtop_uptime));
if(!(server->_priv->machine.boot))
return;
return -GLIBTOP_ERROR_INCOMPATIBLE_KERNEL;
buf->boot_time = server->_priv->machine.boot;
buf->uptime = time(NULL) - server->_priv->machine.boot;
buf->flags = _glibtop_sysdeps_uptime;
return 0;
}