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

Comparing projects/libstatgrab/src/libstatgrab/cpu_stats.c (file contents):
Revision 1.23 by tdb, Wed Apr 7 14:53:40 2004 UTC vs.
Revision 1.24 by ats, Sun Jul 18 21:30:11 2004 UTC

# Line 110 | Line 110 | sg_cpu_stats *sg_get_cpu_stats(){
110   #endif
111   #if defined(LINUX) || defined(CYGWIN)
112          if ((f=fopen("/proc/stat", "r" ))==NULL) {
113 <                sg_set_error(SG_ERROR_OPEN, "/proc/stat");
113 >                sg_set_error_with_errno(SG_ERROR_OPEN, "/proc/stat");
114                  return NULL;
115          }
116          /* The very first line should be cpu */
# Line 132 | Line 132 | sg_cpu_stats *sg_get_cpu_stats(){
132   #if defined(FREEBSD) || defined(DFBSD)
133          size = sizeof cp_time;
134          if (sysctlbyname("kern.cp_time", &cp_time, &size, NULL, 0) < 0){
135 <                sg_set_error(SG_ERROR_SYSCTLBYNAME, "kern.cp_time");
135 >                sg_set_error_with_errno(SG_ERROR_SYSCTLBYNAME, "kern.cp_time");
136                  return NULL;
137          }
138   #else
# Line 145 | Line 145 | sg_cpu_stats *sg_get_cpu_stats(){
145          size = sizeof cp_time;
146          if (sysctl(mib, 2, &cp_time, &size, NULL, 0) < 0) {
147   #ifdef NETBSD
148 <                sg_set_error(SG_ERROR_SYSCTL, "CTL_KERN.KERN_CP_TIME");
148 >                sg_set_error_with_errno(SG_ERROR_SYSCTL,
149 >                                        "CTL_KERN.KERN_CP_TIME");
150   #else
151 <                sg_set_error(SG_ERROR_SYSCTL, "CTL_KERN.KERN_CPTIME");
151 >                sg_set_error_with_errno(SG_ERROR_SYSCTL,
152 >                                        "CTL_KERN.KERN_CPTIME");
153   #endif
154                  return NULL;
155          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines