mirror of
https://github.com/curl/curl.git
synced 2026-08-25 08:53:36 +03:00
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
This commit is contained in:
parent
b228d2952b
commit
1c3e8bbfed
86 changed files with 413 additions and 226 deletions
|
|
@ -260,36 +260,42 @@ static void install_signal_handlers(void)
|
|||
{
|
||||
#ifdef SIGHUP
|
||||
/* ignore SIGHUP signal */
|
||||
if((old_sighup_handler = signal(SIGHUP, SIG_IGN)) == SIG_ERR)
|
||||
old_sighup_handler = signal(SIGHUP, SIG_IGN);
|
||||
if(old_sighup_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGHUP handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGPIPE
|
||||
/* ignore SIGPIPE signal */
|
||||
if((old_sigpipe_handler = signal(SIGPIPE, SIG_IGN)) == SIG_ERR)
|
||||
old_sigpipe_handler = signal(SIGPIPE, SIG_IGN);
|
||||
if(old_sigpipe_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGPIPE handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGALRM
|
||||
/* ignore SIGALRM signal */
|
||||
if((old_sigalrm_handler = signal(SIGALRM, SIG_IGN)) == SIG_ERR)
|
||||
old_sigalrm_handler = signal(SIGALRM, SIG_IGN);
|
||||
if(old_sigalrm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGALRM handler: %s", strerror(errno));
|
||||
#endif
|
||||
#ifdef SIGINT
|
||||
/* handle SIGINT signal with our exit_signal_handler */
|
||||
if((old_sigint_handler = signal(SIGINT, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigint_handler = signal(SIGINT, exit_signal_handler);
|
||||
if(old_sigint_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGINT handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGINT, 1);
|
||||
#endif
|
||||
#ifdef SIGTERM
|
||||
/* handle SIGTERM signal with our exit_signal_handler */
|
||||
if((old_sigterm_handler = signal(SIGTERM, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigterm_handler = signal(SIGTERM, exit_signal_handler);
|
||||
if(old_sigterm_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGTERM handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGTERM, 1);
|
||||
#endif
|
||||
#if defined(SIGBREAK) && defined(WIN32)
|
||||
/* handle SIGBREAK signal with our exit_signal_handler */
|
||||
if((old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler)) == SIG_ERR)
|
||||
old_sigbreak_handler = signal(SIGBREAK, exit_signal_handler);
|
||||
if(old_sigbreak_handler == SIG_ERR)
|
||||
logmsg("cannot install SIGBREAK handler: %s", strerror(errno));
|
||||
else
|
||||
siginterrupt(SIGBREAK, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue