Code

Provide a unified signature for ps_get_cmdline.
authorCorey Kosak <kosak@google.com>
Sat, 23 Jan 2016 00:10:21 +0000 (19:10 -0500)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 26 Jan 2016 06:02:12 +0000 (07:02 +0100)
Prior to this change, ps_get_cmdline had different signatures for
KERNEL_LINUX vs. KERNEL_SOLARIS. This means that callers who want to
call this function would have to have an #if..#else that controlled which
variant of the function to call.

By giving them the same signature, callers don't have to worry about
that.

src/processes.c

index f03056948fc0893380f428ffee56355d604a5d4a..8648614752a301e417f05ea40adf8e5cb1354e96 100644 (file)
@@ -1213,8 +1213,8 @@ static int read_fork_rate ()
 #endif /*KERNEL_LINUX */
 
 #if KERNEL_SOLARIS
-static const char *ps_get_cmdline (long pid, /* {{{ */
-               char *buffer, size_t buffer_size)
+static char *ps_get_cmdline (pid_t pid, char *name __attribute__((unused)), /* {{{ */
+    char *buffer, size_t buffer_size)
 {
        char path[PATH_MAX];
        psinfo_t info;
@@ -2165,7 +2165,7 @@ static int ps_read (void)
 
 
                ps_list_add (ps.name,
-                               ps_get_cmdline (pid, cmdline, sizeof (cmdline)),
+                               ps_get_cmdline (pid, ps.name, cmdline, sizeof (cmdline)),
                                &pse);
        } /* while(readdir) */
        closedir (proc);