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

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.55 by tdb, Fri Jul 16 15:28:02 2004 UTC vs.
Revision 1.56 by ats, Sun Jul 18 21:30:12 2004 UTC

# Line 481 | Line 481 | struct uvmexp *sg_get_uvmexp() {
481          mib[1] = VM_UVMEXP;
482  
483          if (sysctl(mib, 2, &uvm, &size, NULL, 0) < 0) {
484 <                sg_set_error(SG_ERROR_SYSCTL, "CTL_VM.VM_UVMEXP");
484 >                sg_set_error_with_errno(SG_ERROR_SYSCTL, "CTL_VM.VM_UVMEXP");
485                  return NULL;
486          }
487  
# Line 514 | Line 514 | int sg_init(){
514  
515   int sg_drop_privileges() {
516          if (setegid(getgid()) != 0) {
517 <                sg_set_error(SG_ERROR_SETEGID, NULL);
517 >                sg_set_error_with_errno(SG_ERROR_SETEGID, NULL);
518                  return -1;
519          }
520          if (seteuid(getuid()) != 0) {
521 <                sg_set_error(SG_ERROR_SETEUID, NULL);
521 >                sg_set_error_with_errno(SG_ERROR_SETEUID, NULL);
522                  return -1;
523          }
524          return 0;
# Line 528 | Line 528 | void *sg_realloc(void *ptr, size_t size) {
528          void *tmp = NULL;
529          tmp = realloc(ptr, size);
530          if(tmp == NULL) {
531 <                sg_set_error(SG_ERROR_MALLOC, NULL);
531 >                sg_set_error_with_errno(SG_ERROR_MALLOC, NULL);
532          }
533          return tmp;
534   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines