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.34 by tdb, Sun Apr 4 22:09:32 2004 UTC vs.
Revision 1.36 by ats, Sun Apr 4 23:48:26 2004 UTC

# Line 36 | Line 36
36   #endif
37   #if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD)
38   #include <kvm.h>
39 + #include <paths.h>
40   #endif
41   #if defined(NETBSD) || defined(OPENBSD)
42   #include <uvm/uvm_extern.h>
# Line 450 | Line 451 | struct uvmexp *get_uvmexp() {
451          int mib[2];
452          size_t size;
453          static struct uvmexp *uvm = NULL;
454 +        struct uvmexp *new;
455  
456          mib[0] = CTL_VM;
457          mib[1] = VM_UVMEXP;
# Line 458 | Line 460 | struct uvmexp *get_uvmexp() {
460                  return NULL;
461          }
462  
463 <        uvm = realloc(uvm, size);
464 <        if (uvm == NULL) {
463 >        new = realloc(uvm, size);
464 >        if (new == NULL) {
465                  return NULL;
466          }
467 +        uvm = new;
468  
469          if (sysctl(mib, 2, uvm, &size, NULL, 0) < 0) {
470                  return NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines