processes: Fix ps_get_cmdline() on Solaris.
authorJan Andres <jandres@gmx.net>
Wed, 28 Jan 2015 19:00:41 +0000 (20:00 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 19 May 2015 15:42:43 +0000 (17:42 +0200)
Return value of read_file_contents() was checked incorrectly.

src/processes.c

index d6b4845..8dd43e8 100644 (file)
@@ -1205,7 +1205,7 @@ static const char *ps_get_cmdline (pid_t pid, /* {{{ */
        snprintf(path, sizeof (path), "/proc/%i/psinfo", pid);
 
        status = read_file_contents (path, (void *) &info, sizeof (info));
-       if (status != ((int) buffer_size))
+       if (status != sizeof (info))
        {
                ERROR ("processes plugin: Unexpected return value "
                                "while reading \"%s\": "