processes: Fix ps_get_cmdline() on Solaris.
[collectd.git] / src / processes.c
index 6caea54..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\": "
@@ -1787,7 +1787,7 @@ static int ps_read (void)
        int wait     = 0;
 
        kvm_t *kd;
-       char errbuf[1024];
+       char errbuf[_POSIX2_LINE_MAX];
        struct kinfo_proc *procs;          /* array of processes */
        struct kinfo_proc *proc_ptr = NULL;
        int count;                         /* returns number of processes */