summaryrefslogtreecommitdiffstats
path: root/src/test/test-errno-util.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ASSERT_STREQ for simple casesIvan Kruglov2024-04-151-2/+2
|
* errno-util: allow ERRNO_IS_* to accept types wider than intZbigniew Jędrzejewski-Szmek2023-08-161-0/+13
| | | | | | | | This is useful if the variable is ssize_t and we don't want to trigger a warning or truncation. With gcc (gcc-13.2.1-1.fc38.x86_64), the resulting systemd binary is identical, so I assume that the compiler is able to completely optimize away the type.
* basic/errno-util: add wrappers which only accept negative errnoZbigniew Jędrzejewski-Szmek2023-08-161-0/+7
| | | | | | We do 'IN_SET(r, -CONST1, -CONST2)', instead of 'IN_SET(-r, CONST1, CONST2)' because -r is undefined if r is the minimum value (i.e. INT_MIN). But we know that the constants are small, so their negative values are fine.
* Introduce RET_GATHER and use it in src/shared/Zbigniew Jędrzejewski-Szmek2023-07-131-0/+11
| | | | | | The idea is to make it easier to implement the common pattern of accumulating errors (negative values) in an accumulator to return the first error.
* tests: move tests for PROTECT_ERRNO to the right fileZbigniew Jędrzejewski-Szmek2022-11-081-0/+31
| | | | | Also, rename them to uppercase so that the test name matches what we're actually testing.
* tree-wide: define and use STRERROR_OR_EOF()Zbigniew Jędrzejewski-Szmek2022-10-111-0/+6
|
* basic: add STRERROR() wrapper for strerror_r()Zbigniew Jędrzejewski-Szmek2022-10-111-0/+44