summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-04-14 17:29:10 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-04-15 10:00:46 -0700
commitc56da48ee806f73c8ed81afb4a251b24de304620 (patch)
treeafa5464bd1de67a0908484a14b1fbcc04ed6ec9c
parentf6084593c275c5dc1d6154f292991b20bffd68c2 (diff)
Fix const mismatch compiler warnings in Solaris backend
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--src/solx_devfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/solx_devfs.c b/src/solx_devfs.c
index 97de339..7d582ad 100644
--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -89,7 +89,7 @@ typedef struct nexus {
int fd;
int first_bus;
int last_bus;
- const char *path; /* for errors/debugging; fd is all we need */
+ char *path; /* for errors/debugging; fd is all we need */
struct nexus *next;
} nexus_t;
@@ -504,13 +504,13 @@ static int
probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
{
struct pci_system *pci_sys = (struct pci_system *) arg;
- const char *nexus_name;
+ char *nexus_name;
nexus_t *nexus;
int fd;
char nexus_path[MAXPATHLEN];
di_prop_t prop;
- const char *strings;
+ char *strings;
int *ints;
int numval;
int pci_node = 0;
@@ -576,7 +576,6 @@ probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
snprintf(nexus_path, sizeof(nexus_path), "/devices%s", nexus_name);
di_devfs_path_free(nexus_name);
- nexus->path = strdup(nexus_path);
#ifdef DEBUG
fprintf(stderr, "nexus = %s, bus-range = %d - %d\n",
@@ -585,6 +584,7 @@ probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
if ((fd = open(nexus_path, O_RDWR)) >= 0) {
nexus->fd = fd;
+ nexus->path = strdup(nexus_path);
if ((do_probe(nexus, pci_sys) != 0) && (errno != ENXIO)) {
(void) fprintf(stderr, "Error probing node %s: %s\n",
nexus_path, strerror(errno));
@@ -598,7 +598,6 @@ probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
} else {
(void) fprintf(stderr, "Error opening %s: %s\n",
nexus_path, strerror(errno));
- free(nexus->path);
free(nexus);
}