ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/os_info.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/os_info.c (file contents):
Revision 1.20 by tdb, Mon Nov 1 18:30:17 2004 UTC vs.
Revision 1.22 by ats, Sun Nov 7 12:31:33 2004 UTC

# Line 52 | Line 52
52   #include <time.h>
53   #endif
54  
55 + #include "tools.h"
56 +
57   sg_host_info *sg_get_host_info(){
58  
59          static sg_host_info general_stat;
60          static struct utsname os;
61  
62   #ifdef HPUX
63 <        struct pst_static pstat_static;
63 >        struct pst_static *pstat_static;
64          time_t currtime;
65          long boottime;
66   #endif
# Line 91 | Line 93 | sg_host_info *sg_get_host_info(){
93  
94          /* get uptime */
95   #ifdef HPUX
96 <        if (pstat_getstatic(&pstat_static, sizeof(pstat_static), 1, 0) == -1) {
97 <                sg_set_error_with_errno(SG_ERROR_PSTAT, "pstat_static");
96 >        pstat_static = sg_get_pstat_static();
97 >        if (pstat_static == NULL) {
98                  return NULL;
99          }
100  
101          currtime = time(NULL);
102  
103 <        boottime = pstat_static.boot_time;
103 >        boottime = pstat_static->boot_time;
104  
105          general_stat.uptime = currtime - boottime;
106   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines