dhodovsk / source-git / pacemaker

Forked from source-git/pacemaker 3 years ago
Clone

37a86c Refactor: libcrmcommon: introduce new set of return codes

3 files Authored by kgaillot 3 years ago, Committed by rpm-build 3 years ago,
    Refactor: libcrmcommon: introduce new set of return codes
    
    Since we plan to introduce a high-level public API, it's a good time to
    introduce some best practices.
    
    Most Pacemaker API functions currently return an integer return code, such that
    its absolute value is either a system error number or a custom pcmk_err_*
    number. This is less than ideal because system error numbers are constrained
    only to the positive int range, so there's the possibility (though not noticed
    in the wild) that system errors and custom errors could collide.
    
    The new method being introduced here still uses an integer return code,
    but negative values are from a new enumeration, and positive values are
    system error numbers. 0 still represents success.
    
    It is expected that the new method will be used with new functions, and
    existing internal functions will be gradually refactored to use it as well.
    Existing public API functions can be addressed at the next backward
    compatibility break (2.1.0).
    
        
file modified
+58 -1
file modified
+372 -164
file modified
+63 -37