summaryrefslogtreecommitdiff
path: root/examples/first.c
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-12-09 11:38:49 +0000
committerMartin Baulig <martin@src.gnome.org>1998-12-09 11:38:49 +0000
commit1520ee70838db2a183415aaea3ec865ff6ce13ad (patch)
tree2e1494a1ab01fa7f77422f2c990b4f5eebf605cd /examples/first.c
parentee9812e9af80d85b1a1b016e48cd4c0c9bda381e (diff)
downloadlibgtop-1520ee70838db2a183415aaea3ec865ff6ce13ad.tar.gz
Make the return value a `char *' instead of a `const char *'.
1998-12-09 Martin Baulig <martin@home-of-linux.org> * include/glibtop/procargs.h (glibtop_get_proc_args): Make the return value a `char *' instead of a `const char *'.
Diffstat (limited to 'examples/first.c')
-rw-r--r--examples/first.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/first.c b/examples/first.c
index 9ad1ec5f..aabf7884 100644
--- a/examples/first.c
+++ b/examples/first.c
@@ -44,8 +44,8 @@ main (int argc, char *argv [])
glibtop_sysdeps sysdeps;
unsigned c, method, count, port, i, *ptr;
char buffer [BUFSIZ];
- const char *args;
pid_t pid, ppid;
+ char *args;
count = PROFILE_COUNT;
@@ -334,6 +334,11 @@ main (int argc, char *argv [])
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
+ for (i = 0; i < data.proc_args.size; i++) {
+ if (args [i]) continue;
+ args [i] = '|';
+ }
+
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
@@ -439,6 +444,11 @@ main (int argc, char *argv [])
args = glibtop_get_proc_args (&data.proc_args, ppid, 0);
+ for (i = 0; i < data.proc_args.size; i++) {
+ if (args [i]) continue;
+ args [i] = '|';
+ }
+
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,
@@ -545,6 +555,11 @@ main (int argc, char *argv [])
args = glibtop_get_proc_args (&data.proc_args, 1, 0);
+ for (i = 0; i < data.proc_args.size; i++) {
+ if (args [i]) continue;
+ args [i] = '|';
+ }
+
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,