[source] iwcap: fix handling kill signal during dump
LEDE Commits
lede-commits at lists.infradead.org
Thu Dec 14 09:43:29 PST 2017
jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/cfb5a550e4c693a3cb54ae6f6a341d0a5b78d637
commit cfb5a550e4c693a3cb54ae6f6a341d0a5b78d637
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Mar 9 08:53:52 2017 +0100
iwcap: fix handling kill signal during dump
Do not run another loop iteration before checking the stop flag
Signed-off-by: Felix Fietkau <nbd at nbd.name>
(cherry picked from commit 2f09a1e3c950c9b2993ae52d1b0e78317c344470)
---
package/network/utils/iwcap/src/iwcap.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/package/network/utils/iwcap/src/iwcap.c b/package/network/utils/iwcap/src/iwcap.c
index 6bf25c5..bc69550 100644
--- a/package/network/utils/iwcap/src/iwcap.c
+++ b/package/network/utils/iwcap/src/iwcap.c
@@ -490,19 +490,7 @@ int main(int argc, char **argv)
/* capture loop */
while (1)
{
- if (run_stop)
- {
- msg("Shutting down ...\n");
-
- if (promisc)
- set_promisc(0);
-
- if (ring)
- ringbuf_free(ring);
-
- return 0;
- }
- else if (run_dump)
+ if (run_dump)
{
msg("Dumping ring to %s ...\n", output);
@@ -535,6 +523,18 @@ int main(int argc, char **argv)
run_dump = 0;
}
+ if (run_stop)
+ {
+ msg("Shutting down ...\n");
+
+ if (promisc)
+ set_promisc(0);
+
+ if (ring)
+ ringbuf_free(ring);
+
+ return 0;
+ }
pktlen = recvfrom(capture_sock, pktbuf, sizeof(pktbuf), 0, NULL, 0);
frames_captured++;
More information about the lede-commits
mailing list