From: Lennart Poettering Date: Mon, 11 Oct 2021 11:18:50 +0000 (+0200) Subject: signal-util: don't introduce symbols with double underscores X-Git-Tag: v250-rc1~533^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8cc16fd53151a7cb98ce997d490ccf510ed1562;p=thirdparty%2Fsystemd.git signal-util: don't introduce symbols with double underscores ANSI C reserves identifiers beginning with an underscore for compiler internal stuff. We already invade that namespace plenty and probably should not. But even going for the doubly underscore prefixed namespace is a bit too much. Let's just rename the offending table as "static_signal_table[]", since it lists the static defined signals rather than the "dynamic" RTSIGMIN/RTSIGMAX signals. --- diff --git a/src/basic/signal-util.c b/src/basic/signal-util.c index 34b2b279189..f945a96f0de 100644 --- a/src/basic/signal-util.c +++ b/src/basic/signal-util.c @@ -119,7 +119,7 @@ int sigprocmask_many(int how, sigset_t *old, ...) { return 0; } -static const char *const __signal_table[] = { +static const char *const static_signal_table[] = { [SIGHUP] = "HUP", [SIGINT] = "INT", [SIGQUIT] = "QUIT", @@ -155,13 +155,13 @@ static const char *const __signal_table[] = { [SIGSYS] = "SYS" }; -DEFINE_PRIVATE_STRING_TABLE_LOOKUP(__signal, int); +DEFINE_PRIVATE_STRING_TABLE_LOOKUP(static_signal, int); const char *signal_to_string(int signo) { static thread_local char buf[STRLEN("RTMIN+") + DECIMAL_STR_MAX(int)]; const char *name; - name = __signal_to_string(signo); + name = static_signal_to_string(signo); if (name) return name; @@ -190,7 +190,7 @@ int signal_from_string(const char *s) { s += 3; /* Check that the input is a signal name. */ - signo = __signal_from_string(s); + signo = static_signal_from_string(s); if (signo > 0) return signo;