HomeClusterLabs Projects

Log: libcrmcommon: Drop crm_perror() in pid.c

Description

Log: libcrmcommon: Drop crm_perror() in pid.c

And improve error messages. errno is only specified as being set when
the return code is -1. So we don't want to log or return it for
incomplete writes.

The only added benefit of crm_perror() here is that it writes the
messages to stderr for crm_mon (the only caller of pcmkdaemonize(),
which in turn is the only caller of pcmk
lock_pidfile()). However,
no other PID-related errors or pcmkdaemonize() errors get written to
stderr, and CLI tools have verbose flags. So it doesn't seem worth the
hassle of passing a pcmk
output_t object down the call chain.

(Interestingly, pcmk__daemonize() DOES log a couple of errors to
stdout.)

Ref T172

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Thu, Aug 7, 3:05 AM
Parents
rP30b94bb96199: Log: libcrmcommon: Drop crm_perror() in xml_io.c
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task