HomeClusterLabs Projects

Fix: libcrmcommon,tools: improve XML write error handling

Description

Fix: libcrmcommon,tools: improve XML write error handling

The write_xml_*() functions previously would return -1 on error
(only sometimes setting errno for more information) and sometimes
0 (when compressed) or the number of bytes written (when uncompressed) on
success.

Some callers were relying on the return value being -errno, others relied on
errno being set if the return value was negative, and others relied on positive
values indicating success.

Now, the functions always return -errno on error, and the number of bytes
written (whether compressed or uncompressed) on success, and callers treat it
as such.

Also, error log messages have been improved.

Details

Provenance
kgaillotAuthored on Jan 5 2018, 1:19 PM
Parents
rPcbf53fe83437: Feature: stonithd,libcrmcommon: auto-calculate stonith-watchdog-timeout when…
Branches
Unknown
Tags
Unknown

Event Timeline