Refactor: libcrmcommon: Return path from pcmk__procfs_pid2path()
Previously, we required an input buffer and its size as arguments. Now,
we take an output argument, which can be NULL. If not NULL, we
dynamically allocate a buffer and return it via the output argument.
We can pass the full buffer size (PATH_MAX) to readlink(), rather than
passing the buffer size minus one. The readlink(2) man page says to test
for truncation by checking whether the return value is equal to the
buffer size. readlink() doesn't append a terminating null character, but
that's okay, because the buffer is initialized with zeros. If fewer than
PATH_MAX bytes were written, then there's at least one null byte at the
end.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>