From: Corey Kosak Date: Sat, 23 Jan 2016 00:10:21 +0000 (-0500) Subject: Provide a unified signature for ps_get_cmdline. X-Git-Tag: collectd-5.5.2~6^2~43 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=bb978c10e7b6cde5be79ade8b14fcdbb78f7b8ea;p=collectd.git Provide a unified signature for ps_get_cmdline. 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. --- diff --git a/src/processes.c b/src/processes.c index f0305694..86486147 100644 --- a/src/processes.c +++ b/src/processes.c @@ -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);