run-as: reduce verbosity of fd sending error paths
Issue
=====
A testcase in `tests/regression/tools/save-load/test_save` tests that
saving a session on an already existing configuration file fails.
The test case fails as expected but it is a bit noisy in terms of error
reporting:
ok 9 - Enable channel chan-save for session save-42
ok 10 - Enable ust event tp:tptest for session save-42
Error: Attempt to send invalid file descriptor to master (fd = -1)
PERROR - 09:57:10.
893683118 [Client management]: Could not create configuration file: File exists (in save_session() at save.c:2706)
PERROR - 09:57:10.
893714862 [Main]: Failed to close result file descriptor: Bad file descriptor (in send_fds_to_master() at runas.c:824)
ok 11 - Session failed to be saved. Expected!
We see that 3 error statements are printed by the sessiond but only the
second is really relevant.
Fix
===
This commit:
- changes the first `ERR()` statement to a `DBG()` statement, and
- only call `close()` on seemingly valid FDs.
Notes
=====
This commit also removes the mention of "master" in the first `DBG()`
statement as this function is used by both the master and the runas
process.
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie77d44233a770610f8a3f4412b84c0fd70c0812e