From: Yu Watanabe Date: Thu, 12 Dec 2024 02:31:16 +0000 (+0900) Subject: string-table: make DUMP_STRING_TABLE() returns 0 X-Git-Tag: v258-rc1~1887^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a92e0bc6c17bdd4cb1afbc657267c40514226d1;p=thirdparty%2Fsystemd.git string-table: make DUMP_STRING_TABLE() returns 0 Then, we can use it as === return DUMP_STRING_TABLE(...); === --- diff --git a/src/basic/string-table.h b/src/basic/string-table.h index 639443d02b3..83891eeb738 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -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 DUMP_STRING_TABLE(name,type,max) \ - do { \ + ({ \ flockfile(stdout); \ for (type _k = 0; _k < (max); _k++) { \ 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); \ } \ funlockfile(stdout); \ - } while (false) + 0; \ + })