summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-04 21:46:05 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-10-14 17:34:35 -0700
commit803bf3aa28de0f1260e479e2036159d4fead0a87 (patch)
tree420099e86b78aef7f95f0e2cf63c96e44af04069
parentaf4478c52c960bee08209293aa14b784ac30dc05 (diff)
Solaris: Give better error on realloc failure
commit a18460b385ae03 converted from a fixed maximum number of devices to dynamically growing the list via realloc, but didn't update the error message shown on failure. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
-rw-r--r--src/solx_devfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/solx_devfs.c b/src/solx_devfs.c
index d47a846..ea91479 100644
--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -454,8 +454,9 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, probe_info_t *pinfo)
new_num_elems * sizeof (struct pci_device_private));
if (new_devs == NULL) {
(void) fprintf(stderr,
- "Maximum number of PCI devices found,"
- " discarding additional devices\n");
+ "Error allocating memory for PCI devices:"
+ " %s\n discarding additional devices\n",
+ strerror(errno));
return (rval);
}
(void) memset(&new_devs[pinfo->num_devices], 0,