1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00

string-table: make DUMP_STRING_TABLE() returns 0

Then, we can use it as
===
  return DUMP_STRING_TABLE(...);
===
This commit is contained in:
Yu Watanabe 2024-12-12 11:31:16 +09:00
parent 66d2c693ac
commit 2a92e0bc6c

View File

@ -101,7 +101,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
_DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,static) _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,static)
#define DUMP_STRING_TABLE(name,type,max) \ #define DUMP_STRING_TABLE(name,type,max) \
do { \ ({ \
flockfile(stdout); \ flockfile(stdout); \
for (type _k = 0; _k < (max); _k++) { \ for (type _k = 0; _k < (max); _k++) { \
const char *_t; \ const char *_t; \
@ -112,4 +112,5 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
fputc_unlocked('\n', stdout); \ fputc_unlocked('\n', stdout); \
} \ } \
funlockfile(stdout); \ funlockfile(stdout); \
} while (false) 0; \
})