Mercurial > dropbear
comparison svr-main.c @ 1495:0c16b4ccbd54
make signal flags volatile, simplify handling
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 14 Feb 2018 23:06:01 +0800 |
parents | 750ec4ec4cbe |
children | ee7153a05ffc 2d450c1056e3 |
comparison
equal
deleted
inserted
replaced
1494:da095983a60b | 1495:0c16b4ccbd54 |
---|---|
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 val = select(maxsock+1, &fds, NULL, NULL, NULL); | 189 val = select(maxsock+1, &fds, NULL, NULL, NULL); |
190 | 190 |
191 if (exitflag) { | 191 if (ses.exitflag) { |
192 unlink(svr_opts.pidfile); | 192 unlink(svr_opts.pidfile); |
193 dropbear_exit("Terminated by signal"); | 193 dropbear_exit("Terminated by signal"); |
194 } | 194 } |
195 | 195 |
196 if (val == 0) { | 196 if (val == 0) { |
357 } | 357 } |
358 | 358 |
359 /* catch ctrl-c or sigterm */ | 359 /* catch ctrl-c or sigterm */ |
360 static void sigintterm_handler(int UNUSED(unused)) { | 360 static void sigintterm_handler(int UNUSED(unused)) { |
361 | 361 |
362 exitflag = 1; | 362 ses.exitflag = 1; |
363 } | 363 } |
364 | 364 |
365 /* Things used by inetd and non-inetd modes */ | 365 /* Things used by inetd and non-inetd modes */ |
366 static void commonsetup() { | 366 static void commonsetup() { |
367 | 367 |