summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dejean <benoit@placenet.org>2007-06-07 16:30:59 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2007-06-07 16:30:59 +0000
commite387c66aad1ccac97610469c96ca96d9af615f08 (patch)
tree6c4293256ea37892562dee013081a8d88003dbe5
parente774440e77ea29870e6993d0ea82ef76290d8c65 (diff)
downloadlibgtop-e387c66aad1ccac97610469c96ca96d9af615f08.tar.gz
Fixed build. Patch by Damien Carbery <damien.carbery@sun.com>. Closes
2007-06-07 Benoît Dejean <benoit@placenet.org> * proclist.c: (glibtop_get_proclist_s): Fixed build. Patch by Damien Carbery <damien.carbery@sun.com>. Closes #444815. svn path=/trunk/; revision=2604
-rw-r--r--sysdeps/solaris/ChangeLog8
-rw-r--r--sysdeps/solaris/proclist.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog
index 3f4159ed..13701dcf 100644
--- a/sysdeps/solaris/ChangeLog
+++ b/sysdeps/solaris/ChangeLog
@@ -1,3 +1,11 @@
+2007-06-07 Benoît Dejean <benoit@placenet.org>
+
+ * proclist.c: (glibtop_get_proclist_s):
+
+ Fixed build.
+ Patch by Damien Carbery <damien.carbery@sun.com>.
+ Closes #444815.
+
2006-09-19 Benoît Dejean <benoit@placenet.org>
* Makefile.am:
diff --git a/sysdeps/solaris/proclist.c b/sysdeps/solaris/proclist.c
index c0f6075a..52b0a2c6 100644
--- a/sysdeps/solaris/proclist.c
+++ b/sysdeps/solaris/proclist.c
@@ -46,7 +46,7 @@ _glibtop_init_proclist_s (glibtop *server)
}
#define BLOCK_COUNT 256
-#define BLOCK_SIZE (BLOCK_COUNT * sizeof (unsigned))
+#define BLOCK_SIZE (BLOCK_COUNT * sizeof (pid_t))
/* Fetch list of currently running processes.
*
@@ -55,7 +55,7 @@ _glibtop_init_proclist_s (glibtop *server)
* On success, it returnes a pointer to a list of buf->number elements
* each buf->size big. The total size is stored in buf->total. */
-unsigned *
+pid_t*
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
gint64 which, gint64 arg)
{
@@ -63,7 +63,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
struct dirent *entry;
char buffer [BUFSIZ];
unsigned count, total, pid = 0, mask;
- unsigned pids [BLOCK_COUNT], *pids_chain = NULL;
+ pid_t pids [BLOCK_COUNT], *pids_chain = NULL;
unsigned pids_size = 0, pids_offset = 0, new_size;
struct stat statb;
int len, ok;
@@ -98,7 +98,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
if(s_stat(buffer, &statb) < 0)
return NULL;
}
- pids_chain = g_malloc(sizeof(unsigned));
+ pids_chain = g_malloc(sizeof(pid_t));
*pids_chain = pid;
return pids_chain;
}
@@ -216,11 +216,11 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
* new size and copy pids to the beginning of the newly allocated
* block. */
- new_size = pids_size + count * sizeof (unsigned);
+ new_size = pids_size + count * sizeof (pid_t);
pids_chain = g_realloc (pids_chain, new_size);
- memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned));
+ memcpy (pids_chain + pids_offset, pids, count * sizeof (pid_t));
pids_size = new_size;
@@ -231,10 +231,10 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
buf->flags = _glibtop_sysdeps_proclist;
- buf->size = sizeof (unsigned);
+ buf->size = sizeof (pid_t);
buf->number = total;
- buf->total = total * sizeof (unsigned);
+ buf->total = buf->number * buf->size;
return pids_chain;
}