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) |
89 |
|
mapping_t *map_ptr; |
90 |
|
mapping_t *map_end_ptr; |
91 |
|
|
92 |
– |
bsd = strdup(bsd); |
93 |
– |
svr = strdup(svr); |
94 |
– |
|
92 |
|
if (mapping == NULL){ |
93 |
|
mapping = malloc(sizeof(mapping_t)); |
94 |
|
if (mapping == NULL) return; |
111 |
|
} |
112 |
|
|
113 |
|
map_ptr->next = NULL; |
114 |
< |
map_ptr->bsd = bsd; |
115 |
< |
map_ptr->svr = svr; |
114 |
> |
map_ptr->bsd = strdup(bsd); |
115 |
> |
map_ptr->svr = strdup(svr); |
116 |
|
|
117 |
|
return; |
118 |
|
} |
213 |
|
int found; |
214 |
|
|
215 |
|
if ((kc = kstat_open()) == NULL) { |
216 |
< |
return; |
216 |
> |
return 1; |
217 |
|
} |
218 |
|
|
219 |
|
for (ksp = kc->kc_chain; ksp; ksp = ksp->ks_next) { |
407 |
|
} |
408 |
|
|
409 |
|
#endif |
410 |
+ |
|
411 |
+ |
char *update_string(char **dest, const char *src) { |
412 |
+ |
char *new; |
413 |
+ |
|
414 |
+ |
new = realloc(*dest, strlen(src) + 1); |
415 |
+ |
if (new == NULL) { |
416 |
+ |
return NULL; |
417 |
+ |
} |
418 |
+ |
|
419 |
+ |
strcpy(new, src); |
420 |
+ |
*dest = new; |
421 |
+ |
return new; |
422 |
+ |
} |
423 |
|
|
424 |
|
long long get_ll_match(char *line, regmatch_t *match){ |
425 |
|
char *ptr; |