Reflect latest interface changes; especially all functions now return
appropriate error return values on error.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user