[PATCH 3/8] tcpdump: Make loop monitor cooperative

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 11 06:56:36 UTC 2022


This helps a bit if the fgetc() is non-blocking.

Update #4650.
---
 freebsd/contrib/tcpdump/tcpdump.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/freebsd/contrib/tcpdump/tcpdump.c b/freebsd/contrib/tcpdump/tcpdump.c
index b1e7f0d1..74c878a3 100644
--- a/freebsd/contrib/tcpdump/tcpdump.c
+++ b/freebsd/contrib/tcpdump/tcpdump.c
@@ -139,6 +139,7 @@ The Regents of the University of California.  All rights reserved.\n";
 #include <sys/sysctl.h>
 #include <machine/rtems-bsd-commands.h>
 #include <assert.h>
+#include <sched.h>
 #include <rtems.h>
 #include <rtems/linkersets.h>
 #define setpriority(a, b, c)
@@ -1224,6 +1225,8 @@ pcap_loop_monitor(rtems_task_argument arg)
 			pcap_breakloop(pd);
 			break;
 		}
+
+		sched_yield();
 	}
 
 	rtems_task_delete(RTEMS_SELF);
-- 
2.35.3



More information about the devel mailing list