Author: jfrederic.clere(a)jboss.com
Date: 2007-10-18 11:16:12 -0400 (Thu, 18 Oct 2007)
New Revision: 1137
Modified:
trunk/sight/native/os/solaris/volume.c
Log:
Stick to the Solaris example of man swapctl
Modified: trunk/sight/native/os/solaris/volume.c
===================================================================
--- trunk/sight/native/os/solaris/volume.c 2007-10-18 09:13:56 UTC (rev 1136)
+++ trunk/sight/native/os/solaris/volume.c 2007-10-18 15:16:12 UTC (rev 1137)
@@ -240,14 +240,14 @@
/* process swap */
e->num_swap = swapctl(SC_GETNSWP, 0);
- e->num_mounts = e->num_mounts + e->num_swap;
- e->swap_table = apr_palloc(e->pool, sizeof(swapent_t) * e->num_swap +
sizeof(int));
- buf = apr_palloc(e->pool, MAXSTRSIZE * e->num_swap);
- for (i = 0; i < e->num_swap; i++) {
+ e->swap_table = apr_palloc(e->pool, sizeof(swapent_t) * e->num_swap +
sizeof(swaptbl_t));
+ buf = apr_palloc(e->pool, MAXSTRSIZE * e->num_swap + 1);
+ for (i = 0; i < e->num_swap + 1; i++) {
e->swap_table->swt_ent[i].ste_path = buf + (i * MAXSTRSIZE);
}
e->swap_table->swt_n = e->num_swap;
- swapctl(SC_LIST, e->swap_table);
+ e->num_swap = swapctl(SC_LIST, e->swap_table);
+ e->num_mounts = e->num_mounts + e->num_swap;
e->swap_idx = 0;
e->mounts_idx = 0;
Show replies by date