74 |
|
#endif |
75 |
|
|
76 |
|
#ifdef SOLARIS |
77 |
< |
char *get_svr_from_bsd(char *bsd){ |
77 |
> |
const char *get_svr_from_bsd(const char *bsd){ |
78 |
|
#ifdef HAVE_LIBDEVINFO_H |
79 |
|
mapping_t *map_ptr; |
80 |
|
for(map_ptr = mapping; map_ptr != NULL; map_ptr = map_ptr->next) |
411 |
|
|
412 |
|
#endif |
413 |
|
|
414 |
+ |
char *update_string(char **dest, const char *src) { |
415 |
+ |
char *new; |
416 |
+ |
|
417 |
+ |
new = realloc(*dest, strlen(src) + 1); |
418 |
+ |
if (new == NULL) { |
419 |
+ |
return NULL; |
420 |
+ |
} |
421 |
+ |
|
422 |
+ |
strcpy(new, src); |
423 |
+ |
*dest = new; |
424 |
+ |
return new; |
425 |
+ |
} |
426 |
+ |
|
427 |
|
long long get_ll_match(char *line, regmatch_t *match){ |
428 |
|
char *ptr; |
429 |
|
long long num; |
464 |
|
int mib[2]; |
465 |
|
size_t size; |
466 |
|
static struct uvmexp *uvm = NULL; |
467 |
+ |
struct uvmexp *new; |
468 |
|
|
469 |
|
mib[0] = CTL_VM; |
470 |
|
mib[1] = VM_UVMEXP; |
473 |
|
return NULL; |
474 |
|
} |
475 |
|
|
476 |
< |
uvm = realloc(uvm, size); |
477 |
< |
if (uvm == NULL) { |
476 |
> |
new = realloc(uvm, size); |
477 |
> |
if (new == NULL) { |
478 |
|
return NULL; |
479 |
|
} |
480 |
+ |
uvm = new; |
481 |
|
|
482 |
|
if (sysctl(mib, 2, uvm, &size, NULL, 0) < 0) { |
483 |
|
return NULL; |