Changes in uspace/app/top/top.c [1ab8539:d76a329] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/top/top.c

    r1ab8539 rd76a329  
    156156        /* Get current time */
    157157        struct timeval time;
    158         gettimeofday(&time, NULL);
     158        if (gettimeofday(&time, NULL) != EOK)
     159                return "Cannot get time of day";
    159160       
    160161        target->hours = (time.tv_sec % DAY) / HOUR;
     
    163164       
    164165        /* Get uptime */
    165         struct timeval uptime;
    166         getuptime(&uptime);
    167        
    168         target->udays = uptime.tv_sec / DAY;
    169         target->uhours = (uptime.tv_sec % DAY) / HOUR;
    170         target->uminutes = (uptime.tv_sec % HOUR) / MINUTE;
    171         target->useconds = uptime.tv_sec % MINUTE;
     166        sysarg_t uptime = stats_get_uptime();
     167        target->udays = uptime / DAY;
     168        target->uhours = (uptime % DAY) / HOUR;
     169        target->uminutes = (uptime % HOUR) / MINUTE;
     170        target->useconds = uptime % MINUTE;
    172171       
    173172        /* Get load */
Note: See TracChangeset for help on using the changeset viewer.