Deleted Added
full compact
dt_map.c (248708) dt_map.c (269524)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 25 unchanged lines hidden (view full) ---

34#include <assert.h>
35
36#include <dt_impl.h>
37#include <dt_printf.h>
38
39static int
40dt_strdata_add(dtrace_hdl_t *dtp, dtrace_recdesc_t *rec, void ***data, int *max)
41{
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 25 unchanged lines hidden (view full) ---

34#include <assert.h>
35
36#include <dt_impl.h>
37#include <dt_printf.h>
38
39static int
40dt_strdata_add(dtrace_hdl_t *dtp, dtrace_recdesc_t *rec, void ***data, int *max)
41{
42 int maxformat;
42 int maxformat, rval;
43 dtrace_fmtdesc_t fmt;
44 void *result;
45
46 if (rec->dtrd_format == 0)
47 return (0);
48
49 if (rec->dtrd_format <= *max &&
50 (*data)[rec->dtrd_format - 1] != NULL) {

--- 7 unchanged lines hidden (view full) ---

58
59 if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1)
60 return (dt_set_errno(dtp, errno));
61
62 if ((fmt.dtfd_string = dt_alloc(dtp, fmt.dtfd_length)) == NULL)
63 return (dt_set_errno(dtp, EDT_NOMEM));
64
65 if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) {
43 dtrace_fmtdesc_t fmt;
44 void *result;
45
46 if (rec->dtrd_format == 0)
47 return (0);
48
49 if (rec->dtrd_format <= *max &&
50 (*data)[rec->dtrd_format - 1] != NULL) {

--- 7 unchanged lines hidden (view full) ---

58
59 if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1)
60 return (dt_set_errno(dtp, errno));
61
62 if ((fmt.dtfd_string = dt_alloc(dtp, fmt.dtfd_length)) == NULL)
63 return (dt_set_errno(dtp, EDT_NOMEM));
64
65 if (dt_ioctl(dtp, DTRACEIOC_FORMAT, &fmt) == -1) {
66 rval = dt_set_errno(dtp, errno);
66 free(fmt.dtfd_string);
67 free(fmt.dtfd_string);
67 return (dt_set_errno(dtp, errno));
68 return (rval);
68 }
69
70 while (rec->dtrd_format > (maxformat = *max)) {
71 int new_max = maxformat ? (maxformat << 1) : 1;
72 size_t nsize = new_max * sizeof (void *);
73 size_t osize = maxformat * sizeof (void *);
74 void **new_data = dt_zalloc(dtp, nsize);
75

--- 417 unchanged lines hidden ---
69 }
70
71 while (rec->dtrd_format > (maxformat = *max)) {
72 int new_max = maxformat ? (maxformat << 1) : 1;
73 size_t nsize = new_max * sizeof (void *);
74 size_t osize = maxformat * sizeof (void *);
75 void **new_data = dt_zalloc(dtp, nsize);
76

--- 417 unchanged lines hidden ---