aboutsummaryrefslogtreecommitdiff
path: root/tests/server/tftpd.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-12-14 01:29:44 +0100
commit1c3e8bbfedcd3822aeb1bab22fb56c5ecff4295b (patch)
treec1606588aeae4535f0faa7942fcbe50e6e340f8b /tests/server/tftpd.c
parentb228d2952b6762b5c9b851fba0cf391e80c6761a (diff)
checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this now enforces the rule harder.
Diffstat (limited to 'tests/server/tftpd.c')
-rw-r--r--tests/server/tftpd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index 8a4ed0b19..c8667437e 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -367,31 +367,36 @@ 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 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);