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

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.68 by ats, Thu Apr 8 13:44:44 2004 UTC vs.
Revision 1.69 by ats, Sun Jul 18 21:30:11 2004 UTC

# Line 112 | Line 112 | sg_network_io_stats *sg_get_network_io_stats(int *entr
112  
113   #ifdef ALLBSD
114          if(getifaddrs(&net) != 0){
115 <                sg_set_error(SG_ERROR_GETIFADDRS, NULL);
115 >                sg_set_error_with_errno(SG_ERROR_GETIFADDRS, NULL);
116                  return NULL;
117          }
118  
# Line 244 | Line 244 | sg_network_io_stats *sg_get_network_io_stats(int *entr
244   #ifdef LINUX
245          f=fopen("/proc/net/dev", "r");
246          if(f==NULL){
247 <                sg_set_error(SG_ERROR_OPEN, "/proc/net/dev");
247 >                sg_set_error_with_errno(SG_ERROR_OPEN, "/proc/net/dev");
248                  return NULL;
249          }
250          /* read the 2 lines.. Its the title, so we dont care :) */
# Line 437 | Line 437 | sg_network_iface_stats *sg_get_network_iface_stats(int
437  
438   #ifdef ALLBSD
439          if(getifaddrs(&net) != 0){
440 <                sg_set_error(SG_ERROR_GETIFADDRS, NULL);
440 >                sg_set_error_with_errno(SG_ERROR_GETIFADDRS, NULL);
441                  return NULL;
442          }
443  
# Line 545 | Line 545 | sg_network_iface_stats *sg_get_network_iface_stats(int
545          }
546  
547          if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
548 <                sg_set_error(SG_ERROR_SOCKET, NULL);
548 >                sg_set_error_with_errno(SG_ERROR_SOCKET, NULL);
549                  return NULL;
550          }
551  
# Line 604 | Line 604 | sg_network_iface_stats *sg_get_network_iface_stats(int
604   #ifdef LINUX
605          f = fopen("/proc/net/dev", "r");
606          if(f == NULL){
607 <                sg_set_error(SG_ERROR_OPEN, "/proc/net/dev");
607 >                sg_set_error_with_errno(SG_ERROR_OPEN, "/proc/net/dev");
608                  return NULL;
609          }
610  
611          /* Setup stuff so we can do the ioctl to get the info */
612          if((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0){
613 <                sg_set_error(SG_ERROR_SOCKET, NULL);
613 >                sg_set_error_with_errno(SG_ERROR_SOCKET, NULL);
614                  return NULL;
615          }
616  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines